Forum Discussion
Singh_Yoshi
Helper I
1 year agoHelp me with DAX
Hi, I have following table called Table1 as below, Model Code MSRP FJ11 120000 FJ12 136000 FJ13 219800 FJ14 260000 FJ15 325670 I want to subtract FJ11(MSRP) from F...
- 1 year ago
Hi,
Please check the below picture and the attached pbix file.
It is for creating a calculated column.
OFFSET function (DAX) - DAX | Microsoft Learn
LC Calculated Column = VAR _currentrow = 'Table 1'[MSRP] VAR _previousrow = MAXX ( OFFSET ( -1, 'Table 1', ORDERBY ( 'Table 1'[Model Code], ASC ), , , MATCHBY ( 'Table 1'[Model Code] ) ), 'Table 1'[MSRP] ) RETURN IF ( NOT ISBLANK ( _previousrow ), 'Table 1'[MSRP] - _previousrow )
Jihwan_Kim
Super User
1 year agoHi,
Please check the below picture and the attached pbix file.
It is for creating a calculated column.
OFFSET function (DAX) - DAX | Microsoft Learn
LC Calculated Column =
VAR _currentrow = 'Table 1'[MSRP]
VAR _previousrow =
MAXX (
OFFSET (
-1,
'Table 1',
ORDERBY ( 'Table 1'[Model Code], ASC ),
,
,
MATCHBY ( 'Table 1'[Model Code] )
),
'Table 1'[MSRP]
)
RETURN
IF ( NOT ISBLANK ( _previousrow ), 'Table 1'[MSRP] - _previousrow )