Forum Discussion

lherbert501's avatar
lherbert501
Icon for Post Prodigy rankPost Prodigy
11 months ago
Solved

Matrix heatmap with skewed data

Hi,   Could somebody please help with the attached?   I'm stuck on how to conditional format my heatmap matrix, because putting it into percentiles won't necessarily work as in the example the to...
  • GeraldGEmerick's avatar
    11 months ago

    lherbert501 Perhaps you could create a conditional formatting measure like the following and base your conditional formatting on the field value of this measure:

    Background Conditional Formatting = 
        VAR _T = SELECTCOLUMNS( CROSSJOIN( ALL( 'Time Dim'[Time] ), ALL( 'Date Dim'[DayOfWeekNumber] ) ), "_Time", [Time], "_Day#", [DayOfWeekNumber] )
        VAR _Table = 
            ADDCOLUMNS( 
                _T, 
                "Count", COUNTROWS( FILTER( ALL( 'FACT' ), 'FACT'[CreatedRoundedHour] = [_Time] && WEEKDAY( 'FACT'[CreatedDate], 2 ) = [_Day#] ) )
            )
        VAR _Max = MAXX( _Table, [Count] )
        VAR _Percent = DIVIDE( [Count Measure], _Max )
        VAR _Return = 
            SWITCH( TRUE(),
                _Percent = 0, "#00FF00",
                _Percent > .1, "#FF0000"
            )
    RETURN _Return