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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.