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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Percentage Difference Between Years

Hi Experts

 

What is the best way to calculate the Percentage Difference between the Years as shown in the same Data. I would like to plot the % diff in a line chart by Month

Sample Data

Month2019202020212022
Jan10102519
Feb25132425
Mar10252212
Apr13241314
May20162424
Jun19151220
Jul16232321
Aug16131817
Sept11232019
Oct18152410
Nov17211023
Dec19181119
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Select [2019] – [2022] – Transform – Unpivot Columns.

vyangliumsft_0-1683615897692.png

2. Change the [Attribyte] format to Whole number..

vyangliumsft_1-1683615897694.png

3. Create calculated column.

Flag =
var _max=MAXX(ALL('Table'),'Table'[Attribute])
return
IF(
    'Table'[Attribute]=_max,BLANK(),VALUE(RIGHT('Table'[Attribute],2)) +1 &"-"& VALUE(RIGHT('Table'[Attribute],2)))

vyangliumsft_2-1683615918543.png

4. Create measure.

Measure =
var _current=
SUMX(  FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[Attribute]=MAX('Table'[Attribute])),[Value])
var _next=
SUMX(
FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[Attribute]=MAX('Table'[Attribute])+1),[Value])
return
DIVIDE(
    _current,_next)

5. Result:

vyangliumsft_3-1683615918551.png

 

Best Regards,

Liu Yang

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

5 REPLIES 5
devanshi
Helper V
Helper V

To plot the date by monyh you can groupby the date with date(month) & date(year)

For date diff for year 

% datediff(2022-2019,2019)

If it is helpful please accept the answer.

 

 

Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Select [2019] – [2022] – Transform – Unpivot Columns.

vyangliumsft_0-1683615897692.png

2. Change the [Attribyte] format to Whole number..

vyangliumsft_1-1683615897694.png

3. Create calculated column.

Flag =
var _max=MAXX(ALL('Table'),'Table'[Attribute])
return
IF(
    'Table'[Attribute]=_max,BLANK(),VALUE(RIGHT('Table'[Attribute],2)) +1 &"-"& VALUE(RIGHT('Table'[Attribute],2)))

vyangliumsft_2-1683615918543.png

4. Create measure.

Measure =
var _current=
SUMX(  FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[Attribute]=MAX('Table'[Attribute])),[Value])
var _next=
SUMX(
FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[Attribute]=MAX('Table'[Attribute])+1),[Value])
return
DIVIDE(
    _current,_next)

5. Result:

vyangliumsft_3-1683615918551.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Liu Yang - Thank u

Ritaf1983
Super User
Super User

HI @Anonymous 
I'm not sure I understood correctly.
Do you mean to select two years every time and display a change by month between a minimum year and a maximum year when you talk about a change in percentages?
An example of the desired result would be helpful.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

Hi Rita the difference between 22-21 and 21-20 and 20-19 and plot those as percentage diff in a line chart

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.