Forum Discussion
Quick Measure percentage difference gives wrong value
- 9 years ago
Hi MAAbdullah47,
I just verified that the formula works all fine with your shared sample data.
Avg price for 2016 = 219270 and for 2015 = 219058 so the equation should be
Diff = (219270 / 219058 ) - 1 = 0.1 %
Regards
- 9 years ago
Hi MAAbdullah47,
Based on my test, the formula below should work. :smileyhappy:
Diff = VAR currentYear = MAX ( 'saudisale_c'[d_year] ) VAR avgPricePY = CALCULATE ( AVERAGE ( 'saudisale_c'[d_price] ), FILTER ( ALL(saudisale_c[d_year]), 'saudisale_c'[d_year] = currentYear - 1 ) ) RETURN DIVIDE ( AVERAGE ( 'saudisale_c'[d_price] ) - avgPricePY, avgPricePY )Regards
Cuz It is the standard of our company and we should follow it ? If yes can you send me your email to share?
Hi MAAbdullah47,
I just verified that the formula works all fine with your shared sample data.
Avg price for 2016 = 219270 and for 2015 = 219058 so the equation should be
Diff = (219270 / 219058 ) - 1 = 0.1 %
Regards
- v-ljerr-msft9 years agoMicrosoft Employee
Hi MAAbdullah47,
Based on my test, the formula below should work. :smileyhappy:
Diff = VAR currentYear = MAX ( 'saudisale_c'[d_year] ) VAR avgPricePY = CALCULATE ( AVERAGE ( 'saudisale_c'[d_price] ), FILTER ( ALL(saudisale_c[d_year]), 'saudisale_c'[d_year] = currentYear - 1 ) ) RETURN DIVIDE ( AVERAGE ( 'saudisale_c'[d_price] ) - avgPricePY, avgPricePY )Regards
- MAAbdullah479 years agoHelper V
Please check above nothing changed.
- MAAbdullah479 years agoHelper V
Also, another problem some years not labeled.
- MAAbdullah479 years agoHelper V
Fine ,
It works now, Just need to adjust the Format Above, thank you for your support.
- MAAbdullah479 years agoHelper V
Please check your private message, when I do filtering It gives wrong results.
- MAAbdullah479 years agoHelper VThank you I Ll check and get back to u
- MAAbdullah479 years agoHelper V
Thank You so much