Forum Discussion
orana
Helper I
4 years agoUser determined variable in calculation
I'm looking to see if there is a way to take the difference between two variables 1. average sales in 2019 and 2020 for product B-A 2. sales in "x" year for product M-A, where "x" would be determine...
- 4 years ago
Try changing the first calculate to this:
CALCULATE( SUM( 'PL Portfolio'[Trace Units] ), 'PL Portfolio'[Fiscal Year] <= 2020, ALL( 'PL Portfolio'[Fiscal Year] ), 'PL Portfolio'[B & M] = "B - A" )
orana
Helper I
4 years agoHey Pablo ,
I revised my post with the measure that I currently have. Let me know if this helps
Best,
Oscar
PabloDeheza
Solution Sage
4 years agoTry changing the first calculate to this:
CALCULATE(
SUM( 'PL Portfolio'[Trace Units] ),
'PL Portfolio'[Fiscal Year] <= 2020,
ALL( 'PL Portfolio'[Fiscal Year] ),
'PL Portfolio'[B & M] = "B - A"
)
- orana4 years ago
Helper I
The measure is not working. If I use my slicer and click 2021, the measure returns blank.
- v-kkf-msft4 years ago
Community Support
Hi orana ,
I was able to return the correct result using the formula from PabloDeheza . Could you please share your example data? That will help us solve the problem faster.
Best Regards,
Winniz- orana4 years ago
Helper I
Hey,
I just got it to work. I was using another Fiscal Year for the slicer, which is what was driving the "blank".