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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

% Change of this year vs previous years

Hi Team,

 

Need to solve the below and requried ur help.

I need to show the % change from current year vs previous year. Below is the proble and the outpu required.

 

Year	qty		
2017	10		
2018	20		
2019	30		
			
			
Year	qty	% Chage	Logic
2017	10	0%	
2018	20	50%	(10-20)/20
2019	30	67%	(20-30)/30

 

Thanks,

Raj

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

Based on your description, you can create a measure as follows.

 

Measure =

var x1=MAXX(FILTER(ALL(Qty),[Year]=SELECTEDVALUE(Qty[Year])-1&&[Year]>=2017),[qty])

var x2=IF(MAX('Qty'[Year])=2017,MAX('Qty'[qty]),x1)

return

FORMAT(DIVIDE(MAX('Qty'[qty])-x2,MAX('Qty'[qty])),"percent")

 

Result:

v-yuaj-msft_0-1606956487915.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

Based on your description, you can create a measure as follows.

 

Measure =

var x1=MAXX(FILTER(ALL(Qty),[Year]=SELECTEDVALUE(Qty[Year])-1&&[Year]>=2017),[qty])

var x2=IF(MAX('Qty'[Year])=2017,MAX('Qty'[qty]),x1)

return

FORMAT(DIVIDE(MAX('Qty'[qty])-x2,MAX('Qty'[qty])),"percent")

 

Result:

v-yuaj-msft_0-1606956487915.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

There is no pbix file there,

rajveer1117_0-1607008728418.png

 

Hi,

There is.  See bottm left in the image

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

I am not able to find the file.

rajveer1117_0-1606834219025.png

 

 

Regards,

Raj

That is the file (in the image).  Just download it.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.