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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Running difference on line chart

Hi

I am new to power BI and trying to replicate a chart I commonly plot in excel. I have the line chart setup in power BI, but would like to show the running difference between value on different dates (Snapshot attached). 

 

Greatly appreciate your help! 

 

Power BI Chart:

pbi_line_chart.PNG

 

Desired Chart

Desired_chart.PNG

3 REPLIES 3
Tahreem24
Super User
Super User

@Anonymous ,

 

Change X-axis type to Categorial like below screen shot.

 

Capture.JPG

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Hi @Tahreem24  thanks for the reply. The problem is not so much with displaying date format. I want to add the difference bars on alternate axis. Basically trying to visualize a table like this: 

 11/25/201911/29/201912/6/201912/8/201912/9/2019
Value385736386685384155393050382790
Running Diff 949-25308895-10260

 

1. I dont know how to calculate the Running diff in Power BI. 

2. How do i display this on the chart 

@Anonymous ,

 

Step 1: Create Index column in Query Editor. Go to Query Editor --> Select Add COlumn Menu --> Choose Index Column --> Apply and Close Editor

Step 2: Create Calculated column like below:

          Column =
                Var previous_Record =
                                         CALCULATE (
                                            SUM ( 'Table'[Value] ),
                                            FILTER ( 'Table', 'Table'[Index]= EARLIER ( 'Table'[Index])-1 ))
 
                                 RETURN
                                        'Table'[Value]- previous_Record
 
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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