Forum Discussion
Anonymous
4 years agoNot applicable
DAX CALCULATION
I'm trying to GM % on a row based. Net GP/Sales. Please can someone help me.
Anonymous
4 years agoNot applicable
Hi Anonymous ,
Please refer to my pbix file to see if it helps you.
Add an index column first.
Click Home>>Transform data >>Transform data>>Add column>>index column>>From 1.
Then create columns.
actual =
VAR _aactual =
CALCULATE (
MAX ( 'Table'[actual value] ),
FILTER ( ALL ( 'Table' ), 'Table'[Index.1] = EARLIER ( 'Table'[Index.1] ) + 1 )
)
RETURN
DIVIDE ( 'Table'[actual value], _aactual )
budget =
VAR _budget =
CALCULATE (
MAX ( 'Table'[budget values] ),
FILTER ( ALL ( 'Table' ), 'Table'[Index.1] = EARLIER ( 'Table'[Index.1] ) + 1 )
)
RETURN
DIVIDE ( 'Table'[budget values], _budget )
If I have misunderstood your meaning, please provide more details with your desired output and your pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.