Power BI line and clustered column chart

Options

Power BI question: I have a line and clustered column chart and I want the line to be a constant - a value I need to calculate based on filters and averaging. I have created a summary table with the value in it, but since it has only that value, I can't connect it to anything in the data model. I have also tried creating a measure. When I pull the value onto a card, the measure value is constant and correct. When I pull it into the line and clustered column chart, it is no longer a constant line, instead changes based on each column it is over. Anyone have a better idea?

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Laura Hill
    going to need to understand what you are trying to display in order to help.

    what does the line represent? what does the column represent? what data and how are they related?

  • @Alex Wong the columns represent both YTD dollars raised and YTD cash in for the past 4 fiscal years and the current fiscal year. The static line(s), there are actually going to be two, represent the average YTD dollars raised and the average YTD cash in over the last 4 fiscal years (not including current).

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Laura Hill
    so the line (average) is average of YTD giving of the last 4 years? not average giving of the respective year?

    Today is 6/18 for example, is your average cash the average cash of all gifts from 1/1/20-6/18/20, 1/1/21-6/18/21, 1/1/22-6/18/22, 1/1/23-6/18/23 or is your average = average cash of 1/1/20-12/31/23

    Did you use measure? or calcuated column? Measure is going to take the filtering context (not sure if i'm saying this correctly), so a chart that has year on the X axis, your normal average measure will be average of gifts for that year.

  • @Alex Wong my comparison date for this report is January 15, 2024 because I am using static data to try to learn how to build these visualizations. I want to sum all gifts (with some filters in place) from 7-1-2019 to 1-15-2020 (my first column) + gifts from 7-1-2020 to 1-15-2021 (my second column) + gifts from 7-15-2021 - 1-15-2022 (my third column) + gifts from 7-1-2022 to 1-15-2023 (my 4th column) and divide by 4. However, I will have a 5th column for current year (for this example: 7-1-2023 to 1-15-2024) but I don't want gifts during those dates included in the average.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Laura Hill
    what you are trying to do is not familiar to me on building various visualizations.

    I don't know if there are other Power BI expert that's wiling to chrime in, but I think you will not want to use a measure in this case, (or maybe measure that does not take “date filter” into context consideration).

    Meaning, create a calculated column in the date table that puts the 4 year average as a column for all date.

    Last 4 Full FY Average =

    VAR TY = YEAR(TODAY())

    VAR TYm1 = CALCULATE([Cash], FILTER('Date Table', [Year]=TY-1))

    VAR TYm2 = CALCULATE([Cash], FILTER('Date Table', [Year]=TY-2))

    VAR TYm3 = CALCULATE([Cash], FILTER('Date Table', [Year]=TY-3))

    VAR TYm4 = CALCULATE([Cash], FILTER('Date Table', [Year]=TY-4))

    RETURN (TYm1+TYm2+TYm3+TYm4)/4

    my giving data is year based, you can change the above to FY.

    aaa94093641077a415926687c1e8deac-huge-im

    then create a separate line chart that has transparent background on top of the bar chart.

    fb188b705460448f4b86a336c487d20d-huge-im

    This is LIKELY not the best way to do this though.

Categories