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.
Hello experts,
Trying to build a model that compares inventory levels period to period. Trouble is, when the level goes from 0 (or blank) to X, it doesn't calculate that as an increase. Tried the +0 trick but doesn't seem to work either. How can I do this?
Current measure:
Delta QTY = CALCULATE(SUM('Monthly SLoc Value'[Total Q])+0,FILTER('Monthly SLoc Value','Monthly SLoc Value'[Date]=MAX('Calendar'[Date])))
-CALCULATE(SUM('Monthly SLoc Value'[Total Q])+0,FILTER('Monthly SLoc Value','Monthly SLoc Value'[Date]=MIN('Monthly SLoc Value'[Date])))
Results for two different materials. The second which has values each period works, but the first didn't exist period one and thus fails.
Thanks!
Solved! Go to Solution.
Hi @Aron_Moore,
Could you try the formula below to see if it works in your scenario?
Delta QTY = CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MAX ( 'Calendar'[Date] ) ) ) - CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MIN ( 'Calendar'[Date] ) ) )
Regards
Hi @Aron_Moore,
Could you try the formula below to see if it works in your scenario?
Delta QTY = CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MAX ( 'Calendar'[Date] ) ) ) - CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MIN ( 'Calendar'[Date] ) ) )
Regards
Ah, good catch. That did it.
Thanks!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |