Forum Discussion
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 dax1) 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])ReturnIF([datediff]=0, COUNT(Table[Sales]),Avg of daily)I hope you may get the desired result from this!
2 Replies
- amitchandakSuper User
Anonymous ,
Assume you measure is
M1 = count(Table[column])
Create another measure
Averagex(Values(Table[Date]) ,[M1])
Avg of Sum : https://youtu.be/cN8AO3_vmlY?t=22980
- Uzi2019Community Champion
Hi Anonymous
You can similar dax like you have to create seperate measure for Average of daily then create this dax1) 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])ReturnIF([datediff]=0, COUNT(Table[Sales]),Avg of daily)I hope you may get the desired result from this!