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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
oren
Helper III
Helper III

differences between rows in matrix

Hi

 

i have the attache table :

bi3-Capture.JPG

i what to have another table that will show me the differences between row 1 to 2  and then another row that show the change between 2 to 3 , 3 to 4 , etc..

 

thanks

 

1 ACCEPTED SOLUTION

Hi @oren ,

I created a calculated column to implement it. Please modify the formula based on your data model and have a try.

difference = 
var a = CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[ID] = EARLIER('Table'[ID])-1))
return
IF(a= BLANK(),BLANK(),'Table'[Sales] - a)

2.PNG

If the ID column in my sample is not same as yours, you could try to create another column using RANKX to implement.

RANKX = RANKX(FILTER('Table','Table'[Item] = EARLIER('Table'[Item])),'Table'[Sales],,ASC,Dense)

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
oren
Helper III
Helper III

i try this - but it didn't work.

i probably need something also for the columns filter..

bi3-Capture.JPG

 

Hi @oren ,

I created a calculated column to implement it. Please modify the formula based on your data model and have a try.

difference = 
var a = CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[ID] = EARLIER('Table'[ID])-1))
return
IF(a= BLANK(),BLANK(),'Table'[Sales] - a)

2.PNG

If the ID column in my sample is not same as yours, you could try to create another column using RANKX to implement.

RANKX = RANKX(FILTER('Table','Table'[Item] = EARLIER('Table'[Item])),'Table'[Sales],,ASC,Dense)

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.