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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Wolf01
Frequent Visitor

Average of measure

Hello, I would like to ask you for help. I believe, that the solution is easy, but I can't figure it out.

Basically I need to calculate an average of a measure. I tried to give you as detailed explanation as I can. Unfortunately, I can't share the real file.

 

My model looks like this and here are also samples of dummy data for Var1Tab and Var2Tab:

Untitled6.png

oprava vzor dat.PNG

 

Matrixes of Var1 and Var2 look like this: 

MatrixesVar1Var2_oprava.PNG

 

And now I created this measure:

MyMeasure = CALCULATE(DIVIDE(SUM(Var1Tab[Var1]);SUM(Var2Tab[Var2])))+0

 

Matrix with MyMeasure looks like this:

oprava co nechci.PNG

 

And this is my problem, because I need a different result in column Total. I need this:

oprava co chci.PNG

 

To achieve desired result above, I calculated new table:

CalculatedTab = SUMMARIZECOLUMNS(PersonTab[PersonID];'Calendar'[Date].[Year]; 'Calendar'[Date].[Month]; "NewVar";Var1Tab[MyMeasure])

 

When using NewVar in matrix and choosing Average in matrix settings it is doing exactly what I need. But another problem occurs. I am not able to filter by PersonTab[PersonID].

 

So my question is, how to create matrix I need (shown above) and keep the possibility to filter by PersonTab[PersonID]?

 

Thank you for any help!

4 REPLIES 4
Greg_Deckler
Super User
Super User

This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hello Greg_Deckler,

 

Thank you for your article. I went though it and need to go through it more times 🙂

amitchandak
Super User
Super User

Can you share sample data and sample output in excel
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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