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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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