Forum Discussion
as1195
3 years agoHelper I
Matrix total wrong
Hi, I have a matrix and for which the value changes according to the slicer selection.Below is the measure Example= IF(SELECTEDVALUE(table[text])="Number of cells",[Measure1],[Measure2]) when I a...
- 3 years ago
Hi as1195
Please try the followingMeasure2 = COALESCE ( FORMAT ( SUMX ( SUMMARIZE ( Sales, Sales[Value], Sales[Column1], Sales[Column2] ), CALCULATE ( VAR AllCells = SUMMARIZE ( 'Sales', 'Sales'[Country], 'Sales'[Category] ) RETURN COALESCE ( CALCULATE ( DIVIDE ( SUMX ( AllCells, IF ( NOT ISBLANK ( [selection] ), [Selected Value] ) ), [Total Value] ) ), 1 ) ) ), "0%" ), 0 )Example= IF ( SELECTEDVALUE ( Sales[text]) = "Number of cells", [Measure1], [Measure2] )
as1195
3 years agoHelper I
tamerj1
Thank you for the reply!!
Please find the below matrix visual.
When %RSV is selected (Measure2 in above dax) am getting blank values for total and its in percentage format
tamerj1
3 years agoCommunity Champion
Hi as1195
Please try the following
Measure2 =
COALESCE (
FORMAT (
SUMX (
SUMMARIZE ( Sales, Sales[Value], Sales[Column1], Sales[Column2] ),
CALCULATE (
VAR AllCells =
SUMMARIZE ( 'Sales', 'Sales'[Country], 'Sales'[Category] )
RETURN
COALESCE (
CALCULATE (
DIVIDE (
SUMX ( AllCells, IF ( NOT ISBLANK ( [selection] ), [Selected Value] ) ),
[Total Value]
)
),
1
)
)
),
"0%"
),
0
)Example=
IF ( SELECTEDVALUE ( Sales[text]) = "Number of cells", [Measure1], [Measure2] )