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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Matrix Average Aggregation Only Returning Average of Averages

I have a matrix visualization pulling several metrics in rows by date columns. Several of my metrics are calculated columns to get averages for example, total revenue / customer number to get average revenue per customer. But not all my metrics are per customer averages, so I have this measure to have some matrix rows as averages and some as sums (like total revenue) based off an added column listing each as "Sum" or "Avg".

 

ValueWithAggregation = IF(MIN('Booking Date'[Aggregation])="Avg", AVERAGE('Booking Date'[Value]), IF(MIN('Booking Date'[Aggregation]) = "Sum", SUM('Booking Date'[Value]), 0))

 

However, when i move up to weeks/months, for example it's taking each date and averaging the daily averages. How can I get it to sum the revenue metric then divide by the sum of customer metrics as the time drilldown changes for an accurate average? 

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

https://community.powerbi.com/t5/Desktop/Create-a-Chart-with-Hierarchy-of-Month-and-Saturdays-in-that/m-p/458533#M212588

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Could you elaborate? I don't see how that relates...

Greg_Deckler
Super User
Super User

You probably need to use something like HASONEVALUE. Can't be absolutely sure without sample data to play with and expected output. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Also, see if this Quick Measure, Matrix Measure Total Triple Threat Rock & Roll helps:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Matrix-Measure-Total-Triple-Threat-Rock-amp-...

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

 

So, for example it's showing .90 is the average Passengers per PNR for the month of August (attached picture). But what it's doing is taking the daily Passengers per PNR for each day in August, and averaging them, but they're already averages. When I need it to do a real average as below:

 

Broken Average.JPG

 

 August Passengers per PNR  
8/28/20180.625 8/28/201850008000
8/29/20180.833333 8/29/201875009000
8/30/20181 8/30/20181000010000
8/31/20181.136364 8/31/20181250011000
avg of avgs0.898674 sum3500038000
   actual average0.921053 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.