Forum Discussion
cristianml
Post Prodigy
7 years agoDax formula calculate Difference cumulative
Hi,
I need to replicate the following formula as a measure for PBI :
Column D (Acumulative) + Column C - Column B
How can I calculate this?
Thanks,
Hi cristianml
You may try below measure:
Measure = IF ( MAX ( Table1[A] ) = BLANK (), SUM ( Table2[D] ), CALCULATE ( SUM ( Table2[D] ) + SUM ( Table1[C] ) - SUM ( Table1[B] ), FILTER ( ALL ( Table1 ), Table1[A] <= MAX ( Table1[A] ) ) ) )Regards,
4 Replies
- cristianml
Post Prodigy
Hi,
I would like to replicate the following formula in Dax:
"Inventory" (Column D) + "Revenue" (C) - "Billings" (B)
The thing is that I have "Revenue" and "Billings" in same column in my query in Power BI:
Thanks,
- v-cherch-msft
Microsoft Employee
Hi cristianml
You may try below measure:
Measure = IF ( MAX ( Table1[A] ) = BLANK (), SUM ( Table2[D] ), CALCULATE ( SUM ( Table2[D] ) + SUM ( Table1[C] ) - SUM ( Table1[B] ), FILTER ( ALL ( Table1 ), Table1[A] <= MAX ( Table1[A] ) ) ) )Regards,
- cristianml
Post Prodigy
Hi v-cherch-msft ,
Finally I solved it with the following formula:
Actual Inventory =CALCULATE([Actual Revenue] - [Actual Billings],FILTER(ALLSELECTED('List Period'),'List Period'[Date] <= MAX('List Period'[Date])))Thanks & Regards- v-cherch-msft
Microsoft Employee