Forum Discussion

Analitika's avatar
Analitika
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Difference calculation in same table but per different row and tables in Power BI

Hello,

 

I am trying to implement difference calculation. Here is my data table:

My expected result is here:

But I am getting this output which is wrong:

 

0.87!=3289.13

 

Below is DAX query:

Column =
VAR _0 = MAXX(FILTER('x','x'[date]<EARLIER('x'[date]) && 'x'[ID]= EARLIER('x'[ID])),[date])
VAR _1 = MAXX(FILTER('x','x'[date] =_0 && 'x'[ID]= EARLIER('x'[ID]) ),[cre])
return
if('x'[deb] <> 0,_1 - 'x'[deb], blank(

1 Reply