Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Column Chart Daily Average by Filtered Date

Hello,

 

I have a stacked column chart which has hour of day on the x-axis, and count of requests on the y-axis, to display the number of requests we receive by hour.

 

There is also a date filter on the page itself, so of course, when the date range is changed, the visual will update as well.

 

My column chart currently shows the total number of requests made, and I wanted to change this so it shows the daily average, depending on the date range selected.

 

Any assistance would be appreciated.

 

Cheers.

 

 

  • Hi Anonymous 

    You can similar dax like you have to create seperate measure for Average of daily then create this dax

    1) Datediff= 

    DATEDIFF(MIN('Calendar'[Date]),MAX('Calendar'[Date]),DAY)
    It return the no of days between your selected date. 
    2) measure is to calculate count/ avg based on you number of days
    Count_ =
    var c= COUNT(table[sales])
    Return
    IF([datediff]=0, COUNT(Table[Sales]),Avg of daily)
     
    I hope you may get the desired result from this!
     
     

2 Replies

  • Uzi2019's avatar
    Uzi2019
    Community Champion

    Hi Anonymous 

    You can similar dax like you have to create seperate measure for Average of daily then create this dax

    1) Datediff= 

    DATEDIFF(MIN('Calendar'[Date]),MAX('Calendar'[Date]),DAY)
    It return the no of days between your selected date. 
    2) measure is to calculate count/ avg based on you number of days
    Count_ =
    var c= COUNT(table[sales])
    Return
    IF([datediff]=0, COUNT(Table[Sales]),Avg of daily)
     
    I hope you may get the desired result from this!