Forum Discussion
pbiuser0000
5 years agoRegular Visitor
Calculate % Previous Scenario
Hello all, I'm struggling on how to build my measure Here's the context, I have one source as follows : Scenario Product Sales Actual 2018 X 10 Actual 2018 Y 20 Actual...
- 5 years ago
Hi pbiuser0000 ,
It is recommended that you split Scenario column, which is helpful for DAX calculation.
Custom sort for the items in column Scenario in the query editor.Then create a column like below:
Column = var last_ = CALCULATE(FIRSTNONBLANK('Table'[Sales],1),FILTER(ALLEXCEPT('Table','Table'[Scenario.2],'Table'[Product]),EARLIER('Table'[Custom])='Table'[Custom]+1)) return IF(ISBLANK(last_),BLANK(),'Table'[Sales]-last_)Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
V-lianl-msft
Community Support
5 years agoHi pbiuser0000 ,
It is recommended that you split Scenario column, which is helpful for DAX calculation.
Custom sort for the items in column Scenario in the query editor.Then create a column like below:
Column =
var last_ = CALCULATE(FIRSTNONBLANK('Table'[Sales],1),FILTER(ALLEXCEPT('Table','Table'[Scenario.2],'Table'[Product]),EARLIER('Table'[Custom])='Table'[Custom]+1))
return IF(ISBLANK(last_),BLANK(),'Table'[Sales]-last_)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pbiuser0000
5 years agoRegular Visitor
Dear Liang,
Thank you a lot for your help !
It works perfectly well.
Regards.