Forum Discussion
Ben2605
8 years agoNew 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.
| Name | Price | Variance 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
Hello,
Try this:
SupplierVar = SUM(supplier[price])-CALCULATE(SUM(supplier[price]),supplier[name]="c")
just removed Filter from your function :)