Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
hi. i have column Date and column named total Like below:
Date | total | Percentage of change% |
2015 | 5000 | |
2016 | 4000 | |
2017 | 3000 | |
2018 | 2000 | |
2019 | 1000 |
i need to calculate % of change to all years.
Best Regards.
Solved! Go to Solution.
@Anonymous , like this.
prefer to have year or date in ther separate table
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year]))) //Date can be year table
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Change % = divide([This Year]-[Last Year ],[Last Year ])
refer
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
@Anonymous , like this.
prefer to have year or date in ther separate table
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year]))) //Date can be year table
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Change % = divide([This Year]-[Last Year ],[Last Year ])
refer
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
thank you its working perfectly
but why you add - 1 here:
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
and if i would to calculate %Change for month .. can i replace [Year] with [month] like thise:
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[month]=max('Date'[month])))
thank you and best regards
User | Count |
---|---|
93 | |
85 | |
78 | |
68 | |
62 |
User | Count |
---|---|
113 | |
99 | |
96 | |
64 | |
58 |