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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Show % difference between lines in a chart with tooltips

Hello, 

 

I have the following data in a line Chart, it has all months of 2017 and just 9 months in 2018.

 

How can i display the sales difference in percentage between the years by month? 

 

Thank you

 

Year Sales Month

2017581.191
2017545.752
2017534.793
2017493.264
2017522.525
2017529.766
2017568.067
2017516.288
2017531.389
2017525.7210
2017563.4111
2017593.3812
2018556.671
2018517.122
2018603.923
2018580.714
2018592.005
2018592.226
2018617.597
2018623.258
2018645.649
1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

For another way, we could use dax to achieve that.

 

Measure =
CALCULATE ( SUM ( Table1[Sales] ) )
- CALCULATE ( SUM ( Table1[Sales] ), SAMEPERIODLASTYEAR ( 'Table1'[Year] ) )

 

Untitled.png

 

More details, you could refer to the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

3 REPLIES 3
dlopesc04
Resolver II
Resolver II

It should be noted that nowdays we have Dynamic formating, solving this issue and working for charts as well.

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

For another way, we could use dax to achieve that.

 

Measure =
CALCULATE ( SUM ( Table1[Sales] ) )
- CALCULATE ( SUM ( Table1[Sales] ), SAMEPERIODLASTYEAR ( 'Table1'[Year] ) )

 

Untitled.png

 

More details, you could refer to the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CR
Resolver II
Resolver II

Hi @Anonymous

 

Here are the steps I used to create to get that:

 

  • open your query editor
  • add a merged column to concatenate MONTH_YEAR
  • sort on this column

1.png

 

  • add two indexes, one from 0 and one for 1

2.png

 

  • use the function Merge queries as follows 

6.png

 

  • expand the selection by keeping MONTH and SALES

3.png

 

  • add a conditional column SAME MONTH to know if the next line of your current line refers to the same month

4.png

  • add a custom column RESULT saying that IF the next line refers to the same month then substract 

7.png

 

Then you get that:

5.png

 

Regards,

CR

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors