Forum Discussion
In a Matrix hierarchy, alter one node to a desired value
- Anonymous2 years ago
Hi Petr_M ,
Use the All function to ignore any filters that might have been applied during calculatedenominator.
MeasureTotal =
VAR Denominator=CALCULATE([RWA Digit Actual],
FILTER(
ALL('digit_database'),
'digit_database'[NWU]= "B" && 'digit_database'[RWA_TYPE] = "X"
))
VAR Ratio = 24/Denominator
VAR TotalSales=SUMX(
SUMMARIZE(
digit_database,
digit_database[NWU],digit_database[RWA_TYPE],
"CalculatedValue",
IF(
SELECTEDVALUE(digit_database[NWU]) = "B",
SWITCH(digit_database[RWA_TYPE],"X",
SUMX(
FILTER(digit_database, digit_database[NWU] = "B" ),
[RWA Digit Actual] * Ratio
),[RWA Digit Actual]),
SUMX(
FILTER(digit_database, digit_database[NWU] <> "B"),
[RWA Digit Actual]
)
)
),
[CalculatedValue]
)
RETURN TotalSales
Another simple measure for your reference:
Measure =VAR Denominator = CALCULATE([RWA Digit Actual],FILTER(ALL('digit_database'),'digit_database'[NWU] = "B" && 'digit_database'[RWA_TYPE] = "X"))VAR Ratio = 24 / DenominatorRETURN SUMX(ADDCOLUMNS(digit_database,"CalculatedValue",IF([NWU] = "B" && [RWA_TYPE] = "X",[RWA Digit Actual] * Ratio,[RWA Digit Actual])),[CalculatedValue])
Result:
Best regards,Joyce
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Petr_M ,
Sorry for forgetting to change the test data, I've updated the above reply to the correct version.
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried to change the 3 to Denominator before, but this leads to everything under X being 24.
- Anonymous2 years agoNot applicable
Hi Petr_M ,
Use the All function to ignore any filters that might have been applied during calculatedenominator.
MeasureTotal =
VAR Denominator=CALCULATE([RWA Digit Actual],
FILTER(
ALL('digit_database'),
'digit_database'[NWU]= "B" && 'digit_database'[RWA_TYPE] = "X"
))
VAR Ratio = 24/Denominator
VAR TotalSales=SUMX(
SUMMARIZE(
digit_database,
digit_database[NWU],digit_database[RWA_TYPE],
"CalculatedValue",
IF(
SELECTEDVALUE(digit_database[NWU]) = "B",
SWITCH(digit_database[RWA_TYPE],"X",
SUMX(
FILTER(digit_database, digit_database[NWU] = "B" ),
[RWA Digit Actual] * Ratio
),[RWA Digit Actual]),
SUMX(
FILTER(digit_database, digit_database[NWU] <> "B"),
[RWA Digit Actual]
)
)
),
[CalculatedValue]
)
RETURN TotalSales
Another simple measure for your reference:
Measure =VAR Denominator = CALCULATE([RWA Digit Actual],FILTER(ALL('digit_database'),'digit_database'[NWU] = "B" && 'digit_database'[RWA_TYPE] = "X"))VAR Ratio = 24 / DenominatorRETURN SUMX(ADDCOLUMNS(digit_database,"CalculatedValue",IF([NWU] = "B" && [RWA_TYPE] = "X",[RWA Digit Actual] * Ratio,[RWA Digit Actual])),[CalculatedValue])
Result:
Best regards,Joyce
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
- Petr_M2 years agoFrequent Visitor
Thank you so much, works perfectly!