Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Guys,
Hope you kepping well. I have an issue and cannot fix this. I beleive this is soemthing really simple but....
| Date | Item number | Avg Unit cost 2019 | Current unit cost | Variance |
| 14/02/2020 | 12 | 2.37 | 0 | 2.37 |
| 12/02/2020 | 12 | 2.37 | 2.30 | 0.07 |
| 10/03/2020 | 1 | 1.3 | 1.1 | 0.2 |
The Variance is calculated Avg Unit Cost 2019 - Current Unit Cost
So:
2.37 - 2.3 = 0.07
1.3 - 1.1 = 0.2
and
2.37 - 0 = 2.37 which is ok however, I am looking somethign different.
So I want to compare the current average purchase price with the previous. But when I subtracting from zero it will always give me previos value not 0.
I want
If the Current Unit Cost = 0
return Zero in Variance Unit cost
OTHERWISE
Current Product Unit Cost - Avg Product Unit cost
SEND HELP!!
Thnak you
BigTommy
Solved! Go to Solution.
please try
if ( currentunitcost=0, 0, currentunitcost-avgunitcost )
Proud to be a Super User!
Hey, thank you. Is working!
@BigTommy , Try like
new column =
if ( Table[currentunitcost]=0, 0, Table[currentunitcost]-Table[avgunitcost] )
new measure =
if ( Avg(Table[currentunitcost])=0, 0, Avg([currentunitcost])-Avg([avgunitcost]) )
please try
if ( currentunitcost=0, 0, currentunitcost-avgunitcost )
Proud to be a Super User!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 54 | |
| 40 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 94 | |
| 83 | |
| 33 | |
| 32 | |
| 24 |