Forum Discussion
guruscz
1 year agoFrequent Visitor
Non additive measure - advanced weighted average
Hi all, I am building weighted average based on several conditions. Below is the measure which is calculationg the weighted average of power based on real generation of power plant which is in p...
- 1 year ago
In the end I fix the problem it was all coming from diff calculation. So I had to split the diff calculation like below
VAR hedge_volume = SUMX( FILTER(DealGroupPWR, NOT DealGroupPWR[StrategyID] IN {1, 2, 3}), DealGroupPWR[GROUP_TotalVolumeMW]) VAR real_generation = SUMX( FILTER(DealGroupPWR, DealGroupPWR[StrategyID] IN {1, 2, 3}), DealGroupPWR[GenerationHedgeVolume]) VAR diff = IF(real_generation = 0, 0, real_generation - hedge_volume) RETURN IF(HASONEVALUE('delivery date'[date]), diff, SUMX( VALUES('delivery date'[date]), IF( CALCULATE(SUMX(FILTER(DealGroupPWR, DealGroupPWR[StrategyID] IN {1, 2, 3}), DealGroupPWR[GenerationHedgeVolume])) = 0, 0, -- real generation condition CALCULATE(SUMX(FILTER(DealGroupPWR, DealGroupPWR[StrategyID] IN {1, 2, 3}), DealGroupPWR[GenerationHedgeVolume])) - -- real generation volume CALCULATE(SUMX(FILTER(DealGroupPWR, NOT DealGroupPWR[StrategyID] IN {1, 2, 3}), DealGroupPWR[GROUP_TotalVolumeMW])) ) -- hedge volume ) )
Anonymous
1 year agoNot applicable
Hi guruscz,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
B Manikanteswara Reddy