Forum Discussion
Percentage difference measure
- Anonymous2 years ago
Hi gbarr12345 ,
Ritaf1983 Thanks for your concern about this case!
And gbarr12345 , the problem should be with these two measures of yours:
Here I build a sample data myself:Measures:
Depletion First 12 Months = CALCULATE( SUM('Table'[Depletion]), ALL('Table'), MONTH('Table'[Date]) >= 1 && MONTH('Table'[Date]) <= 12 && 'Table'[Year] IN VALUES('Table'[Year]) )Exports First 12 Months = CALCULATE( SUM('Table'[Exports]), ALL('Table'), MONTH('Table'[Date]) >= 1 && MONTH('Table'[Date]) <= 12 && 'Table'[Year] IN VALUES('Table'[Year]) )Year 1 % difference = VAR Dep = [Depletion First 12 Months] VAR Exports = [Exports First 12 Months] RETURN IF( Exports <> 0, DIVIDE(Dep, Exports, 0), BLANK() )And the final output is as below:
If there is still a problem, could you please provide your sample data, and the DAX you created for these two measures, please!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi gbarr12345 ,
Ritaf1983 Thanks for your concern about this case!
And gbarr12345 , the problem should be with these two measures of yours:
Here I build a sample data myself:
Measures:
Depletion First 12 Months =
CALCULATE(
SUM('Table'[Depletion]),
ALL('Table'),
MONTH('Table'[Date]) >= 1 && MONTH('Table'[Date]) <= 12 && 'Table'[Year] IN VALUES('Table'[Year])
)Exports First 12 Months =
CALCULATE(
SUM('Table'[Exports]),
ALL('Table'),
MONTH('Table'[Date]) >= 1 && MONTH('Table'[Date]) <= 12 && 'Table'[Year] IN VALUES('Table'[Year])
)Year 1 % difference =
VAR Dep = [Depletion First 12 Months]
VAR Exports = [Exports First 12 Months]
RETURN
IF(
Exports <> 0,
DIVIDE(Dep, Exports, 0),
BLANK()
)
And the final output is as below:
If there is still a problem, could you please provide your sample data, and the DAX you created for these two measures, please!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- gbarr123452 years agoPost Prodigy
That works! Thank you so much!