Forum Discussion
Help with DAX
- Anonymous1 year ago
Hi Singh_Yoshi ,
I created a sample pbix file(see the attachment), please check if that is what you want.
1. Add a index column in Power Query Editor
= Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type)2. Create a measure as below
Measure = VAR _index = SELECTEDVALUE ( 'Table'[Index] ) VAR _curmsrp = SUM ( 'Table'[MSRP] ) VAR _nextmsrp = CALCULATE ( SUM ( 'Table'[MSRP] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _index + 1 ) ) RETURN DIVIDE(_nextmsrp ,(( _curmsrp+[Contents])*100))If the above one can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format, the formula of measure [Contents] and your expected result with backend logic and special examples. You can add the required info in my attached pbix file.
Best Regards
Hi Singh_Yoshi ,
I created a sample pbix file(see the attachment), please check if that is what you want.
1. Add a index column in Power Query Editor
= Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type)
2. Create a measure as below
Measure =
VAR _index =
SELECTEDVALUE ( 'Table'[Index] )
VAR _curmsrp =
SUM ( 'Table'[MSRP] )
VAR _nextmsrp =
CALCULATE (
SUM ( 'Table'[MSRP] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] = _index + 1 )
)
RETURN
DIVIDE(_nextmsrp ,(( _curmsrp+[Contents])*100))
If the above one can't help you figure out, please provide some raw data in your tables (exclude sensitive data) with Text format, the formula of measure [Contents] and your expected result with backend logic and special examples. You can add the required info in my attached pbix file.
Best Regards