Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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...
  • tamerj1's avatar
    tamerj1
    3 years ago

    Anonymous 
    Please try

    Above 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 ) )
        )