Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
What I want to do:
Sort column C by the "difference from", "Scen2" column shown below in descending order.
What I tried doing already:
1. Create a "Difference From" column from "Value Field Setting" and sort --> did not work
2. Create a measure to simulate "Difference From" through Power Query --> sorting seems to work but the columns are mixed as highlighted in yellow above.
DAX Formula:
=VAR sum_scen1 = CALCULATE(SUM(Table1[annual]), Table1[A]="Scen1")
VAR sum_scen2 = CALCULATE(SUM(Table1[annual]), Table1[A]="Scen2")
RETURN sum_scen2-sum_scen1
I wish there is a place to attach the file but here it is!
Thank you!
Solved! Go to Solution.
Hi @Anonymous ,
Please show grand totals in Excel. Does this match your desired output?
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try the measure and change the subtotal label.
Measure =
VAR sum_scen1 =
CALCULATE ( SUM ( Table1[annual] ), Table1[A] = "Scen1" )
VAR sum_scen2 =
CALCULATE ( SUM ( Table1[annual] ), Table1[A] = "Scen2" )
RETURN
IF ( ISFILTERED ( Table1[A] ), SUM ( Table1[annual] ), sum_scen2 - sum_scen1 )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply!
However, this solution does not seem to work in Excel Power Query/Power Pivot.
Would you please take a look at this again?
Thanks!
Hi @Anonymous ,
Please show grand totals in Excel. Does this match your desired output?
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The link yields a 401