Forum Discussion
Anonymous
6 years agoNot applicable
Excluding outside filter context
Hi all, In the below tables I am trying to create a measure which does a calculation as shown in the Output table. For a given Plant-Business-Month, sum of each type of heirarchy is divided by t...
v-lionel-msft
Community Support
6 years agoHi Anonymous ,
Try to create four measures.
Measure =
CALCULATE(
SUM(Sheet1[VALUE]),
FILTER(
Sheet2,
Sheet2[HEIRARCHY] = SELECTEDVALUE(Sheet2[HEIRARCHY]) && Sheet2[HEIRARCHY] <> "Volume"
),
FILTER(
Sheet1,
Sheet1[MONTH] = SELECTEDVALUE(Sheet1[MONTH])
)
)Measure 2 =
VAR x =
CALCULATE(
SUM(Sheet1[VALUE]),
FILTER(
Sheet2,
Sheet2[HEIRARCHY] = SELECTEDVALUE(Sheet2[HEIRARCHY]) && Sheet2[HEIRARCHY] = "Volume"
),
FILTER(
Sheet1,
Sheet1[MONTH]= SELECTEDVALUE(Sheet1[MONTH])
)
)
RETURN
xMeasure 3 =
VAR x =
SUMX(
FILTER(
ALL(Sheet1),
Sheet1[MONTH] = SELECTEDVALUE(Sheet1[MONTH])
),
[Measure 2]
)
RETURN
xMeasure 4 =
DIVIDE(
[Measure], [Measure 3],
BLANK()
)
(Note: Do not combine Measure2 and Measure3 into one formula, as this may cause problems.)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
6 years agoAnonymous , Also refer : https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/