Forum Discussion
asimpleman9to5
4 years agoFrequent Visitor
Difference between rows
Hi all. First Photo Second Photo From the screenshots shown above, the first photo is how my data is seen now. I would require the serial numbers to be filtered and groupe...
- 4 years ago
Hi,
Please check the below picture and the attached pbix file.
It is for creating measures.
Voltage measure: = IF ( HASONEVALUE ( Data[Serial No] ), SUM ( Data[Voltage] ) )Row Diff measure: = VAR _currentvoltage = [Voltage measure:] VAR _currentrow = MAX ( 'Test Type'[Index] ) VAR _nextrow = MINX ( FILTER ( ALL ( 'Test Type' ), 'Test Type'[Index] > _currentrow ), 'Test Type'[Index] ) VAR _nextrowvoltage = CALCULATE ( [Voltage measure:], FILTER ( ALL ( 'Test Type' ), 'Test Type'[Index] = _nextrow ) ) RETURN IF ( HASONEVALUE ( 'Serial No'[Serial No] ), IF ( ISBLANK ( _nextrow ), "null", _currentvoltage - _nextrowvoltage ) )
Jihwan_Kim
4 years agoSuper User
Hi,
Please check the below picture and the attached pbix file.
It is for creating measures.
Voltage measure: =
IF ( HASONEVALUE ( Data[Serial No] ), SUM ( Data[Voltage] ) )
Row Diff measure: =
VAR _currentvoltage = [Voltage measure:]
VAR _currentrow =
MAX ( 'Test Type'[Index] )
VAR _nextrow =
MINX (
FILTER ( ALL ( 'Test Type' ), 'Test Type'[Index] > _currentrow ),
'Test Type'[Index]
)
VAR _nextrowvoltage =
CALCULATE (
[Voltage measure:],
FILTER ( ALL ( 'Test Type' ), 'Test Type'[Index] = _nextrow )
)
RETURN
IF (
HASONEVALUE ( 'Serial No'[Serial No] ),
IF ( ISBLANK ( _nextrow ), "null", _currentvoltage - _nextrowvoltage )
)
asimpleman9to5
4 years agoFrequent Visitor
Thank you for your extensive help. I greatly appreciate it.