Forum Discussion
T-Ilias
2 years agoRegular Visitor
Multi level measure with DAX
Hello everyone, Could you please help me on this calculation ? I have a table called cost, looks something like this : Market Production center Year L1 Cost Structure L2 Cost Struct...
- 2 years ago
Thanks.
I end up doing this :SUMX(SUMMARIZE('Cost','Cost'[L1 Cost Structure],'Cost'[L2 Cost Structure],'Cost'[L3 Cost Structure],"CostPerVolume", SUM('Cost'[Cost(M USD)]) / SUM('Cost'[Sales Volume(M)]) * 1000),[CostPerVolume])And it worked. will try the inscope too just to have options in future.
amitchandak
Super User
2 years agoT-Ilias , You can use isinscope to handle this, but it work in Bar, Matrix not Table visual
// in method two
SWITCH(TRUE(),
Isinscope('Cost'[L3 Cost Structure]), [L3Level],
Isinscope('Cost'[L2 Cost Structure]), [L2Level],
Isinscope('Cost'[L1 Cost Structure]) , [L1Level]
)
IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM
T-Ilias
2 years agoRegular Visitor
Thanks.
I end up doing this :
SUMX(
SUMMARIZE(
'Cost',
'Cost'[L1 Cost Structure],
'Cost'[L2 Cost Structure],
'Cost'[L3 Cost Structure],
"CostPerVolume", SUM('Cost'[Cost(M USD)]) / SUM('Cost'[Sales Volume(M)]) * 1000
),
[CostPerVolume]
)
And it worked. will try the inscope too just to have options in future.