Forum Discussion
Anonymous
3 years agoNot applicable
Count values above threshold in a matrix table
Hello, I appreciate if you can help me with the below. I have 4 cities and 4 stores and want to build a 4x4 performance matrix and count values above 90%. The counting should be both in columns and...
- 3 years ago
Anonymous
Please tryAbove 90% = VAR T1 = SUMMARIZE ( 'Table', 'Table'[GEO], "@Percentage", [Percentage Measure] ) VAR T2 = SUMMARIZE ( 'Table', 'Table'[Store], "@Percentage", [Percentage Measure] ) RETURN SWITCH ( TRUE (), HASONEVALUE ( 'Table'[GEO] ) && HASONEVALUE ( 'Table'[Store] ), [Percentage Measure], HASONEVALUE ( 'Table'[Store] ), COUNTROWS ( FILTER ( T1, [@Percentage] > 0.9 ) ), COUNTROWS ( FILTER ( T2, [@Percentage] > 0.9 ) ) )
tamerj1
Community Champion
3 years agoHi Anonymous
Place the following measure in the values of the matrix instead of the current one.
Above 90% =
VAR T =
SUMMARIZE (
'Table',
'Table'[GEO],
'Table'[Store],
"@Percentage", [Percentage Measure]
)
RETURN
IF (
COUNTROWS ( T ) = 1,
[Percentage Measure],
COUNTROWS ( FILTER ( T, [@Percentage] > 0.9 ) )
)Anonymous
3 years agoNot applicable
tamerj1, this is brilliant, it works! Thank you so much for the solution and swift reply. I will definitely accept it as solution. Just one improvement: the total comes as sum of each city counting. Is it possible to count the total figures independently?
- tamerj13 years ago
Community Champion
Anonymous
I'm not sure what exactly do you mean but I'm sure it can be done. So would you please clarify with a screenshot that includes some markups?
- Anonymous3 years agoNot applicable
tamerj1, thank you for still being around.
Ideally, row "Total" should be 1 as only store 1 is above 90. The solution provided is generating 5 (the sum of above 90s in all cities). Hope that clarifies.
- tamerj13 years ago
Community Champion
Anonymous
Please tryAbove 90% = VAR T1 = SUMMARIZE ( 'Table', 'Table'[GEO], "@Percentage", [Percentage Measure] ) VAR T2 = SUMMARIZE ( 'Table', 'Table'[Store], "@Percentage", [Percentage Measure] ) RETURN SWITCH ( TRUE (), HASONEVALUE ( 'Table'[GEO] ) && HASONEVALUE ( 'Table'[Store] ), [Percentage Measure], HASONEVALUE ( 'Table'[Store] ), COUNTROWS ( FILTER ( T1, [@Percentage] > 0.9 ) ), COUNTROWS ( FILTER ( T2, [@Percentage] > 0.9 ) ) )