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 am trying to use this as values in matrix am getting blank total for measure2
To fix the matrix total I tried using below dax.But still I am getting blank total
when I am trying to use this as values in matrix am getting blank total for measure2
To fix the matrix total I tried using below dax.But still I am getting blank total
Test =
IF(HASONEVALUE(Sales[Value]),[Measure2],SUMX(VALUES(Sales[Value]),[Measure2]))
Below is the measure2 formula
Below is the measure2 formula
Measure2 =
VAR AllCells = SUMMARIZE('Sales','Sales'[Country],'Sales'[Category])
RETURN COALESCE(
FORMAT(COALESCE(CALCULATE(
DIVIDE(
SUMX(AllCells, IF(NOT ISBLANK([selection]), [Selected Value])),
[Total Value]
)
), 1), "0%")
, 0)
Please help!!
Thanks in Advance!!
Please help!!
Thanks in Advance!!
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] )
3 Replies
- tamerj1Community Champion
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] )