Forum Discussion
% Difference between Measures
I dont understand very well about json option but trying to follow your example getting this
Hi edume,
Yes, you could use calculated column to create column which is similar to my M code. You problem is that you miss the () in expression. You could try below expression
% =
(
CALCULATE ( SUM ( 'Ratios y Metricas'[Importe Neto Rappel Generico] ) )
- CALCULATE (
SUM ( 'Ratios y Metricas'[Importe Neto Rappel Generico] );
FILTER (
ALL ( 'Ratios y Metricas'[Año] );
'Ratios y Metricas'[Año]
= MIN ( 'Ratios y Metricas'[Año] ) - 1
)
)
)
/ CALCULATE ( SUM ( 'Ratios y Metricas'[Importe Neto Rappel Generico] ) )
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
It doenst work
being honest I dont understand how something seems so easy such as "% differences between figures" finally is so complex to do.
- dax6 years agoCommunity Support
Hi edumen,
It seems that it is cuased by your sample structure, so if possible, could you please inform me your sample data or your pbix file? Then I will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hey
First I would split the fiscal year field or create another one from that one with just the number (stored as a number).
Then I would create a measure as following (just a guide, adapt so it takes your fields and tables):
measure =
var fiscalyear = SELECTEDVALUE(FY_number)
var currentYear = CALCULATE(SUM('ratios y metricas'[importe neto]), FY_number = fiscalyear)
var previousYear = CALCULATE(SUM('ratios y metricas'[importe neto]), FY_number = (fiscalyear - 1))
var result = DIVIDE(currentYear, previousYear, BLANK())
return result