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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MichaelWinz
Frequent Visitor

Force Aggregation to a specified dimension

I am attempting to implement a measure that averages a count over the day of the week for a specified time period.   When I used Tableau I was able to accomplish his with Level of Detail calculations.   It seems like some combination of CountX and AverageX would do the same in PowerBI.  I just can't wrap my brain around how to approach this problem. 

 

Here's an example of what I've tired.  

 

Visit Count By Day of Week = AVERAGEX( Values('PatientFlow StatusOrderBASE'[Date - Day of Week]), Calculate(DISTINCTCOUNT('PatientFlow StatusOrderBASE'[VisitID] )))

 

 

The attached visual is a total count for each day.  I'd like to see the average count for a specifed time period for a specific day of the week.  

 

MichaelWinz_0-1672950251500.png

 

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @MichaelWinz ,

I created some data:

vyangliumsft_0-1672972171381.png

 

Here are the steps you can follow:

1. Create calculated column.

Weekday = WEEKDAY('Table'[Date])

2. Create measure.

Measure =
AVERAGEX(FILTER(ALLSELECTED('Table'),'Table'[Weekday]=MAX('Table'[Weekday])),[Value])

3. Result:

vyangliumsft_1-1672972171386.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

This doesn't work in my situation.   The measure being summed is always 1.    What I need is an Average of Sums Across WeedDays.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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