Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
FinleyCarroll
New Member

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.

 

FinleyCarroll_0-1714692535078.png

 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @FinleyCarroll 

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!
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

2 REPLIES 2
Uzi2019
Super User
Super User

Hi @FinleyCarroll 

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!
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!
amitchandak
Super User
Super User

@FinleyCarroll ,

 

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.