Forum Discussion
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:
Desired Chart
3 Replies
- Tahreem24Super User
Anonymous ,
Change X-axis type to Categorial like below screen shot.
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
- AnonymousNot 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/2019 11/29/2019 12/6/2019 12/8/2019 12/9/2019 Value 385736 386685 384155 393050 382790 Running Diff 949 -2530 8895 -10260 1. I dont know how to calculate the Running diff in Power BI.
2. How do i display this on the chart
- Tahreem24Super User
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_RecordDon't forget to hit Thumbs up and accept this as a solution if you find it helpful!