Forum Discussion

Clament's avatar
Clament
Regular Visitor
3 years ago
Solved

DAX measure

I need help i wrote DAX measure for clustered column chat to return green when the target is achieved and red when is not i have two columns Target and Measure my DAX formual is (color=if([target]>[A...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Clament ,

    As the one what I said in my previous post, we can't make conditional formatting for the column chart. We can refer the method in the following blog to get the same requirement.

    How to do conditional formatting in Power BI Column Charts

    I updated your sample pbix file(see the attachment), please check if that is what you want. 

    1. Create two measures as below to get the sum of actual with different conditions

    Above Actual = 
    IF (
        SUM ( 'Sheet1'[target] ) <= SUM ( 'Sheet1'[actual] ),
        SUM ( 'Sheet1'[actual] )
    )
    Below Actual = 
    IF (
        SUM ( 'Sheet1'[target] ) > SUM ( 'Sheet1'[actual] ),
        SUM ( 'Sheet1'[actual] )
    )

    2. Put the above measures onto the visual to replace the field [actual] with the aggregation "Sum" and set the different color for them

    Best Regards