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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Ben2605
New Member

Price variance measure

Hello,

 

I'm relatively new to PowerBI and hoping someone can help me with what seems a simple problem - it would take 2 seconds in excel but I'm struggling with DAX to get the 'right' answer in PowerBI.

 

I have a table called 'Supplier' containing a number of suppliers and unit prices. I'd like to set up a table showing the price difference between supplier 'c' and each of the suppliers.

 

NamePriceVariance to C
a £1-£2
b £2-£1
c £3 £-  
d £4 £1
e £5 £2
f £6 £3

 

I've written the following measure..

 

SupplierVar = SUM(supplier[price])-CALCULATE(SUM(supplier[price]),FILTER(supplier,supplier[name]="c"))

 

The measure above does not give me the desired result. 

 

Any pointers would be appreciated.

 

Thanks

1 ACCEPTED SOLUTION
Washivale
Resolver V
Resolver V

Hello,

 

Try this:

 

SupplierVar = SUM(supplier[price])-CALCULATE(SUM(supplier[price]),supplier[name]="c")

 

just removed Filter from your function 🙂

View solution in original post

2 REPLIES 2
Washivale
Resolver V
Resolver V

Hello,

 

Try this:

 

SupplierVar = SUM(supplier[price])-CALCULATE(SUM(supplier[price]),supplier[name]="c")

 

just removed Filter from your function 🙂

how frustrating - such a simple solution!

 

Thanks @Washivale for the quick response.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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