Forum Discussion
DAX: Difference Percentage(Current Week % - Previous Week%)
Below is the example what i am looking I want to create a new column where i should see the Diffrence %
Product ID "142263-013" for Current wk diffrence is "-15%"(100%-115%) & "142263-013" -63%(100%-163%)
Please note Forecastintegrity% is caluclated column
Regards,
Hari
Hi harirao ,
Go to query editor>add column>Index column:
Then you can create a calculated column to achieve what you need:
Column =
var a=CALCULATE(MAX('Table'[Forcastintergity%]),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])&&'Table'[Product ID]=EARLIER('Table'[Product ID])))
Return
IF(a=BLANK(),BLANK(),'Table'[Forcastintergity%]-a)
And you will see:
Or you can create a measure instead:
Measure =
var a=CALCULATE(MAX('Table'[Forcastintergity%]),FILTER(ALL('Table'),'Table'[Index]<SELECTEDVALUE('Table'[Index])&&'Table'[Product ID]=SELECTEDVALUE('Table'[Product ID])))
Return
IF(a=BLANK(),BLANK(),MAX('Table'[Forcastintergity%])-a)
And you will see:
For the related .pbix file,pls click here.
Kelly
- harirao6 years agoPost Prodigy
Thanks for your solution,
Please note: Forecastintegrity% is calculated measure, both solution is not working.
Regards,
Hari
- v-kelly-msft6 years agoCommunity Support
Hi harirao ,
Sorry I thought Forecastintegrity% is a calculated column,if it's a measure,it'd better first change into a calculated column,could you pls advise me the dax expression of Forecastintegrity% if you dont know how to change?
Or if it's possible,could you pls upload your .pbix file to onedrive business and share the link with us?
Best Regards,
KellyDid I answer your question? Mark my post as a solution!- harirao6 years agoPost Prodigy
Hi v-kelly-msft ,
Please find the below dax used for calculations
When i created column for Forecastintegrity% i was not getting correct result, I tried doing "Don't Summarize" i was get 100%.
Regards,
Hari