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 21, 2019 in Power BI by Phalguni
• 1,020 points
9,818 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 21, 2019 by EdurekaUser
• 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,970 points
278 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 17, 2019 in Power BI by Cherukuri
• 33,010 points
7,728 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,970 points
9,249 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,370 points
299 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,370 points
237 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,370 points
334 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 23, 2019 in Power BI by EdurekaUser
• 1,500 points

edited May 23, 2019 by Omkar 165 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 27, 2019 in Power BI by EdurekaUser
• 1,500 points
3,658 views