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
PeterStuhr
Helper V
Helper V

Compare price to average prices for same selections

Hi all, I have a Supplier table with the following:

 

[SupplierID], [Job Type], [Product], [Price].

 

So I am doing a matrix showing SupplierID --> Job type --> Product, and the Price for each of those.

 

What I need is to also show the average, not split by Supplier.

 

Example: 

 

SupplierIDJob TypeProductPrice
1ServiceBeer20
2ServiceBeer40

 

In the Matrix I want to show that for Supplier 1, the Price for Service and Beer is 20, while the Average of Service and Beer is 30. So I can see that Supplier 1 is the cheapest. Ofcourse we have many combinations of Job Type and Product, but this is the idea. best regards!

2 REPLIES 2
lkalawski
Memorable Member
Memorable Member

@PeterStuhr ,

 

You can create the measure:

 

Prive Avg =
CALCULATE (
    AVERAGE ( 'Table'[Price] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Job Type] = SELECTEDVALUE ( 'Table'[Job Type] )
            && 'Table'[Product] = SELECTEDVALUE ( 'Table'[Product] )
    )
)



_______________
If I helped, please accept the solution and give kudos! 😀

 

amitchandak
Super User
Super User

@PeterStuhr , Try this measure -

 

calculate(average(Table[Price]), allexpcept(Table,Table[Type],Table[Product]))

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.