Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Conditional Formatting with % and criteria

Hi There,   I am having asn issue while creating conditional formatting. I have one column which is Service Level (%) and having values in % along with that i have criteria based on LOB'S present ...
  • SamWiseOwl's avatar
    1 year ago

    Hi Anonymous 

    Create a measure in your table and use that for formatting:

    Colour measure =

    var ser = sum('Table'[Service level]) --if this is a measure just put the measure name

    var lob = selectedValue('Table'[LOBs])

    RETURN
    Switch(
    True()
    , ser > 0.7 || ser > 0.55 && lob IN {"A","B"} || lob = "D" && ser > 60

    ,"Green"

    , ser > 0.6 || ser > 0.50 && lob IN {"A","B"} || lob = "D" && ser > 50

    ,"Yellow"

    , ser > 0.5 || ser > 0.45 && lob IN {"A","B"} || lob = "D" && ser > 40

    ,"Red"

    ,"Blue")

    Then assign this to your field formatting:

     

  • SamWiseOwl's avatar
    SamWiseOwl
    1 year ago

    (lob = "D" || si in {"d(I)",d(ii)})  && ser > 60

     

    Need the brackets so they happen at the same time.

    Assuming its Lob = D OR Si = "d(i)" if it is AND use &&