How do I calculate difference between consecutive rows and columns

0 votes

Hi,

 I want to display the differences between value for the following data

     Column 1 | Column 2 | Column 3 | Column 4 | Column 5

           200           100            350            900              800

Diff:           -100          +250          +550            -100

How do I calculate difference between consecutive rows and columns?

May 20, 2019 in Power BI by Phalguni
• 1,020 points
8,092 views

1 answer to this question.

0 votes

There are two ways through which you can do this:

Method 1: 

Calculated column = 
VAR RowAbove=
CALCULATE (
SUM (Table[Value]),
FILTER (Table, Table[Index] = EARLIER (Table[Index]) - 1))
RETURN
Table[Value] - RowAbove
Method 2: 
Diff One vs Two = [Column 1] - [Column 2]
Hope This Helps!!
answered May 20, 2019 by avantika
• 1,500 points

Related Questions In Power BI

0 votes
1 answer

How DAX Difference between naked SUM and sum wrapped in CALCULATE?

This is materially different than the question ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,870 points
74 views
0 votes
1 answer

Difference between measure and calculate column in power BI

Hi Rahul,  With calculated columns, you can add new ...READ MORE

answered May 16, 2019 in Power BI by Cherukuri
• 32,910 points
6,001 views
0 votes
1 answer

How do I count rows in one table based on values in another table using DAX?

If the tables are related, this is ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,870 points
2,998 views
0 votes
1 answer

Install Power BI Desktop

It’s a pretty simple process. All you ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,310 points
209 views
0 votes
1 answer

Few tips before I start creating Power BI dashboard

It’s always advisable to begin with the data ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,310 points
176 views
0 votes
1 answer

How do I format the KPI in Power BI

format the KPI by selecting the paint ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 52,310 points
220 views
+1 vote
1 answer
0 votes
1 answer

How do I add a filter and a slicer?

Hi, Its OLTP and DW modeling. However, you ...READ MORE

answered May 22, 2019 in Power BI by avantika
• 1,500 points

edited May 23, 2019 by Omkar 115 views
0 votes
1 answer

How do I convert month format in Power BI?

Hi, This can easily be done using DAX ...READ MORE

answered Mar 26, 2019 in Power BI by avantika
• 1,500 points
3,307 views