Forum Discussion

Dooriya101's avatar
Dooriya101
Frequent Visitor
3 years ago
Solved

Conditionally Formatting reflects all bars with same colour

Hi All,   I'm trying to use conditional formatting in bar chart however after I applied all bars shows the same colour.   Purpose: Have team's average #case by PC, and +- 2% shows green, +- 5% s...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Dooriya101 ,

    I created a sample pbix file base on your provided data and measures, and I found that the value of measure [Baseline for monthly average number] is same with the ones of measure [Avg Case by PC]. That's why all of bars show the green color. You can try to update the formula of measure [Baseline for monthly average number]  as below and check if it can get your expected result...

    Baseline for monthly average number =
    VAR _totalcases =
        CALCULATE ( [Total Case Number], ALLSELECTED ( 'Case Table' ) )
    VAR _totalpc =
        CALCULATE ( [Total PC], ALLSELECTED ( 'Main Table' ) )
    VAR _numofmonth =
        CALCULATE (
            DISTINCTCOUNT ( 'Case Table'[Month] ),
            ALLSELECTED ( 'Case Table' )
        )
    RETURN
        DIVIDE ( DIVIDE ( _totalcases, _totalpc ), _numofmonth )

    Best Regards