Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
Expand all | Collapse all

Min/max points on line graph

  • 1.  Min/max points on line graph

    Posted Mar 03, 2021 10:42 AM

    I need to show min/max points with data labels on a graph showing call volumes.  My solution works until I modify the date range.  I created some cards to display the calculated values, and those values are adjusting as expected, but the graphs are not.  Note that I have two graphs, one for weekends and another for weekdays.  And my base measure is average calls per hour per day.

     

    Weekend graph showing min/max data points with labels

     

    Here are the measures for Max Weekend point

    1. Avg Hourly Calls = AVERAGE('Avg Incoming Calls per Hour/Day'[Avg Calls])
    2. Avg Hourly Calls - max point on weekends =MAXX( FILTER( ALLSELECTED(DateDim), DateDim[WeekEndYN] = "Y"), [Avg Hourly Calls])
    3. Avg Hourly Calls - date of weekend max point = CALCULATE(VALUES(DateDim[Date]),FILTER(ALL(DateDim[Date]),[Avg Hourly Calls]=[Avg Hourly Calls - max point on weekends]))
    4. Avg Hourly Calls - weekend maximum = CALCULATE([Avg Hourly Calls], FILTER('DateDim', DateDim[Date]=[Avg Hourly Calls - date of weekend max point]),DateDim[WeekEndYN]="Y")
     
    I have fiddled with using ALL versus ALLSELECTED but am not getting either to work as desired.  Your help is appreciated!


    ------------------------------
    Sherry Sparks
    ------------------------------


  • 2.  RE: Min/max points on line graph

    Gold Contributor
    Posted Mar 04, 2021 05:17 PM
    Hi Sherry,

    I'm not sure I understand quite everything that is happening here.  Do you have a date/calendar table that is connected to your fact table?  I would suggest creating one if you don't already have.  I found this video that works quite nicely, but it admittedly does not have as many moving parts as listed above.

    https://www.youtube.com/watch?v=YfPB-TcRZ0E

    Do you have a file you can share with the forum?

    Best of luck,

    Ashley

    ------------------------------
    AHsia

    Did my reply help? Please recommend.
    ------------------------------