Forum Discussion
Help with DAX
- Anonymous1 year ago
Hi, Singh_Yoshi
I simply modeled a portion of the data and hope it fits your situation.
Pre MSRP = CALCULATE(MAX('Table'[MSRP]),FILTER(ALL('Table'),[MSRP]<SELECTEDVALUE('Table'[MSRP])))LC = IF([Pre MSRP]=BLANK(),BLANK(),SUM('Table'[MSRP])-[Pre MSRP])Sum Measure = SWITCH(TRUE(), SELECTEDVALUE('Table'[Model Code])="FJ11",BLANK(), SELECTEDVALUE('Table'[Model Code])="FJ16",[FJ11-16], SELECTEDVALUE('Table'[Model Code])="FJ7",[FJ16-7], SELECTEDVALUE('Table'[Model Code])="FJ8",[FJ7-8], SELECTEDVALUE('Table'[Model Code])="FJ15",[FJ8-15], SELECTEDVALUE('Table'[Model Code])="FJ12",[FJ15-12])Result1 = [LC]-[Sum Measure]Result2 = DIVIDE(SUM('Table'[MSRP]),[Pre MSRP]+[Sum Measure]*100)Is this the result you expected?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Singh_Yoshi
I simply modeled a portion of the data and hope it fits your situation.
Pre MSRP = CALCULATE(MAX('Table'[MSRP]),FILTER(ALL('Table'),[MSRP]<SELECTEDVALUE('Table'[MSRP])))LC = IF([Pre MSRP]=BLANK(),BLANK(),SUM('Table'[MSRP])-[Pre MSRP])Sum Measure = SWITCH(TRUE(),
SELECTEDVALUE('Table'[Model Code])="FJ11",BLANK(),
SELECTEDVALUE('Table'[Model Code])="FJ16",[FJ11-16],
SELECTEDVALUE('Table'[Model Code])="FJ7",[FJ16-7],
SELECTEDVALUE('Table'[Model Code])="FJ8",[FJ7-8],
SELECTEDVALUE('Table'[Model Code])="FJ15",[FJ8-15],
SELECTEDVALUE('Table'[Model Code])="FJ12",[FJ15-12])Result1 = [LC]-[Sum Measure]Result2 = DIVIDE(SUM('Table'[MSRP]),[Pre MSRP]+[Sum Measure]*100)
Is this the result you expected?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous Everything is perfect. This is almost what I expected. But the Please modify Result2 formula alone as below.
MSRP of FJ16 / SUM(MSRP of FJ11 + Sum Measure)
eg: 1580000/(1392000+(-1674)) = 1.1%