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

Percent change from prior year

I need to do a calculation of percent change from percentage results

the first layer was to calculate the percent mix per column on a year to year basis example: 

 

2018_YTD = CALCULATE(SUM('Table1'[Value number]),DATESBETWEEN('Table'[Value date],date(2018,1,1),DATE(2018,MONTH(TODAY()),day(TODAY()))))

 

2019_YTD = CALCULATE(SUM('Table'[Value number]),'Table'[Field with year number]=2019)

 

These two results, I dragged and dropped in the Value field in the vizualization pane, and selected show value as a percent of column total to obtain the results as a % 

 

then, Created this other formula between the two years, but this results show only the growth from 2018 into 2019.

% Chg = Divide('Table'[2019_YTD],'Table'[2018_YTD])-1

 

What I need is the change between the percentages see below

 

This is the result I need20182019% change between years:
Owner             28.20%   30.56%   8.4%          (this is = (30.56%/28.20%) - 1  
Tenant  71.80%69.44%-3.3%

 

DAX formula gives  
 20182019 
Owner1497258373%
Tenant3811586854%

 

 

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

Hi @Anonymous ,

 

To create measures as below.

2018_YTD = CALCULATE(SUM('Table1'[Value number]),DATESBETWEEN(Table1[date],date(2018,1,1),DATE(2018,MONTH(TODAY()),day(TODAY()))))
2019_YTD = CALCULATE(SUM(Table1[Value number]),Table1[Field with year number]=2019)
2018 % = DIVIDE([2018_YTD],SUMX(ALLSELECTED(Table1[role]),[2018_YTD]))
2019 % = DIVIDE([2019_YTD],SUMX(ALLSELECTED(Table1[role]),[2019_YTD]))
% change between years = DIVIDE([2018 %],[2019 %])-1

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create measures as below.

2018_YTD = CALCULATE(SUM('Table1'[Value number]),DATESBETWEEN(Table1[date],date(2018,1,1),DATE(2018,MONTH(TODAY()),day(TODAY()))))
2019_YTD = CALCULATE(SUM(Table1[Value number]),Table1[Field with year number]=2019)
2018 % = DIVIDE([2018_YTD],SUMX(ALLSELECTED(Table1[role]),[2018_YTD]))
2019 % = DIVIDE([2019_YTD],SUMX(ALLSELECTED(Table1[role]),[2019_YTD]))
% change between years = DIVIDE([2018 %],[2019 %])-1

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.