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

How to add a line chart which calculate/measure the different between 2 line chart

Hi !

I am  new to Power BI.

I have 3 Period on my query.

I want to compare the differences between a period. 

For example I have Last Year and Today Period , I want a line graph which show the differences between 2 of them.

My today period will be constant .  Any guide will be helpful to me!

cclemonq10_0-1626864847905.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you @amitchandak 

I made 3  measure based on your example.

1.TODAY Measure use as base or constant
2. Measure that will be selected by slicer for

3. Differences based measure TODAY and measure selected by slicer.

 

I put all of the measure into the line chart and all display correctly.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Ask is not very clear. But based on what I got. Measure with help from date tbale

 

 

example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

diff = [MTD Sales]-[last year MTD Sales]
diff % = divide([MTD Sales]-[last year MTD Sales],[last year MTD Sales])

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Anonymous
Not applicable

Thank you @amitchandak 

I made 3  measure based on your example.

1.TODAY Measure use as base or constant
2. Measure that will be selected by slicer for

3. Differences based measure TODAY and measure selected by slicer.

 

I put all of the measure into the line chart and all display correctly.

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.