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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.