Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

DAX for Calculate Percentage of change

hi. i have column Date and column named total Like below:

DatetotalPercentage of change%
20155000 
20164000 
20173000 
20182000 
20191000 

i need to calculate % of change to all years.

Best Regards.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@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
Not applicable

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

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.