Forum Discussion

IPGeorgiev's avatar
IPGeorgiev
Helper III
6 years ago
Solved

Measure based on Column

Hi,

 

I have the following issue:

 

I have  a matrix which looks like this:

 

 

So the types here are the types of communication - Written or Voice.

 

So I will have a KPI1% under the two availible columns "Written" and "Voice"

 

I want to add coniditional formatting for KPI1% based on the targets that I have - however! the targets are different for the different communication types. So I cant have both as applying the targets for written for example will mean that the same conditional formatting will be added under "Voice" column as well.

 

1. Is it possible to have different conditional formatting based on the column value?

 

2. I guess 1) is not possible therefore I have tried to use quick measures.

 

I click right button KPI1% and select quick measure then I add a filter to be , for example, type="Written". This adds a new measure KPI1% for Written - this works as expected, HOWEVER I know have this value "KPI1% for Written" two times - under column "Written" and under Column "Voice" - is it possible to have this ONLY under the "Written" column?

 

Many thanks in advance!


Best regards,
Ivan

  • Right, so thinking of a measure like:

    Measure?
    VAR __Type to MAX('Table'[Type])
    VAR __RedThreshold - IF(__Type to "Written",.75,.85)
    VAR __KPI1 [KPI1%]
    Return
    IF(__KPI1 <-__RedThreshold,"Red","Green")

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    You *should* be able to create a new measure that does the coding based upon the Type. You would then use this new measure for your rules. But, impossible to be specific because there are large gaps in required information like what are the rules that you are trying to implement for the color coding?

    • IPGeorgiev's avatar
      IPGeorgiev
      Helper III

      Hi Greg_Deckler ,

       

      many thanks for the response!

       

      Here  more information:

       

      KPI1% is between 0% and 100%.

       

      If the type is Written:

       

      Values between 0% and 75% should be colored (background) in red.

      Values between 75.01% and 100% should have green background 

       

      If the type is Voice:

       

      Values between 0% and 85% should be colored (background) in red.

      Values between 85.01% and 100% should have green background 

       

      Many thanks in advance!!

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion
        Right, so thinking of a measure like:

        Measure?
        VAR __Type to MAX('Table'[Type])
        VAR __RedThreshold - IF(__Type to "Written",.75,.85)
        VAR __KPI1 [KPI1%]
        Return
        IF(__KPI1 <-__RedThreshold,"Red","Green")