Forum Discussion
Measure Optimization - Margin Analysis
- Anonymous5 years ago
Hi Anonymous
It took a little bit time to go through your measures. The -3045% came with a little modification on your original ones, all the EstimateTotalCost, you only need to add all the cost, but not iteration (means no SUMX).
Is the Margin% comparing with TotalCost not Revenue?
InHouseMargins = VAR T1 = GENERATE ( GROUPBY ( SalesHistory, SalesHistory[SO] ), VAR EstimateType = [EstimateType] VAR TotalRevenue = [SumTotalRevenue] VAR TotalCost = [EstimatedTotalCost] RETURN ROW ( "EstType", EstimateType, "TotalRevenue", TotalRevenue, "TotalCost", TotalCost ) ) VAR T2 = FILTER ( T1, [EstType] = "In-House" ) RETURN ( SUMX ( T2, [TotalRevenue] ) - SUMX ( T2, [TotalCost] ) ) / SUMX ( T2, [TotalCost] )Basically, I re wrote some of your measures. There should be better ways, but I checked the performance of mine in DAX Studio, all seem ok. PM your email, I can send you the .pbix file.
Hi Anonymous,
Did Vera_33 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestion to help others who faced similar requirements to find it more quickly.
If these also not help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng