Forum Discussion
Calculate Difference Between Rows (Row Data is a Measure, Not a Calc Column)
- 5 years ago
Hi, samdep
Please check the below picture and the link down below (sample pbix file) whether it is what you are looking for.
The measure is in the sample pbix file.
Diff qty count =
VAR currentnumber =
MAX ( 'Table'[Day Calc Column] )
VAR onerowbefore =
CALCULATE (
MAX ( 'Table'[Day Calc Column] ),
FILTER ( ALL ( 'Table' ), 'Table'[Day Calc Column] < currentnumber )
)
VAR onerowbeforeqty =
CALCULATE ( [total qty], 'Table'[Day Calc Column] = onerowbefore )
RETURN
IF ( NOT ISBLANK ( onerowbeforeqty ), [total qty] - onerowbeforeqty, BLANK () )https://www.dropbox.com/s/afahpn09tch8lii/samdep.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi, samdep
Please check the below picture and the link down below (sample pbix file) whether it is what you are looking for.
The measure is in the sample pbix file.
Diff qty count =
VAR currentnumber =
MAX ( 'Table'[Day Calc Column] )
VAR onerowbefore =
CALCULATE (
MAX ( 'Table'[Day Calc Column] ),
FILTER ( ALL ( 'Table' ), 'Table'[Day Calc Column] < currentnumber )
)
VAR onerowbeforeqty =
CALCULATE ( [total qty], 'Table'[Day Calc Column] = onerowbefore )
RETURN
IF ( NOT ISBLANK ( onerowbeforeqty ), [total qty] - onerowbeforeqty, BLANK () )
https://www.dropbox.com/s/afahpn09tch8lii/samdep.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.