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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
newhopepdx
Helper III
Helper III

Confusing Averages

I just can't seem to wrap my head around averaging when slicing!

 

The measures in the demo.pbix (https://www.dropbox.com/scl/fi/iuj5d8rkzmfl7yoayg41e/Demo.pbix?rlkey=lkergwyytvgekzl8aoenfkjmg&st=vw...) all work as long as only one item is selected in the slicer that corresponds to that field. But when more than one field is selected it groups each slicer selection separately and then averages.

 

In the example, Average x Event & x GroupTyper are correct, but x Venue is not as its used 6 entries for Venue A & 6 entries for Venue B and divided by 12, instead of 6.

 

What's the proper measure(s) to obtain the average that reflects the condition set by all four slicers?

Demo_-_Power_BI_Desktop2411-207.jpg

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@newhopepdx If you only want 6 entries then you don't SUMMARIZE by both date and venue, you would just use date. Also, your DAX is really odd in terms of how you hae constructed it.

Average x Venue 2 = 
    VAR __Table = SUMMARIZE(AttendanceData,AttendanceData[Date], "Attendance", [Attended])
    VAR __Result = AVERAGEX( __Table, [Attendance] )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@newhopepdx If you only want 6 entries then you don't SUMMARIZE by both date and venue, you would just use date. Also, your DAX is really odd in terms of how you hae constructed it.

Average x Venue 2 = 
    VAR __Table = SUMMARIZE(AttendanceData,AttendanceData[Date], "Attendance", [Attended])
    VAR __Result = AVERAGEX( __Table, [Attendance] )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.