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
jorge_mejia
New Member

Manipulating Measures by Different Cuts

Hello Power BI Community,

 

 

I am trying to calculate the Average Sales Price (ASP) for each material in my database. The database is basically thousands of single purchasing transactions:

database.PNG

 

 

I have created a measure (ASP) using two other measures (total sales and total quantity). I can put this measure with account names in a table and it will summarize and show me the Average Sales Price for that material.

ASP Formula.PNG

ASP by Material.PNG

I can also do the same thing and add Account Name and my table will now tell me the Average Sales Price for a material by a specific Account Name:

ASP by Account Name.PNG

 

What I want to do is be able to divide the ASP shown in the first table (by material) with the one in the second table (by Account Name) in order to see whether the Account pays higher or lower than the average. 

 

Does anyone have any idea on how to do this? Thank you so much in advance !

 

Best,

Jorge

 

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @jorge_mejia,

Please create a measure using the similar formulas.

Average=CALCULATE(AVERAGE(Table[Sales Price]),ALLEXCEPT(Table,Table[material]))


I test using my sample table.

1.PNG

Create a measure using the formula using the formula below and get expected result.

Average = CALCULATE(AVERAGE(Table1[value]),ALLEXCEPT(Table1,Table1[Material]))

2.PNG

Best Regards,
Amgelia


View solution in original post

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @jorge_mejia,

Please create a measure using the similar formulas.

Average=CALCULATE(AVERAGE(Table[Sales Price]),ALLEXCEPT(Table,Table[material]))


I test using my sample table.

1.PNG

Create a measure using the formula using the formula below and get expected result.

Average = CALCULATE(AVERAGE(Table1[value]),ALLEXCEPT(Table1,Table1[Material]))

2.PNG

Best Regards,
Amgelia


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.