Forum Discussion
dynamic conditional formatting
- 10 months ago
Add a DAX code
Don’t feel overstressed color =
IF (
[meassure] >= 0 && [meassure] < DIVIDE ( [Don't feel overstressed], 2 ),
1,
IF (
[meassure] >= DIVIDE ( [Don't feel overstressed], 2 )
&& [meassure] < [Don't feel overstressed],
2,
3
)
)
ThenChoose the KPI in your matrix and press the arrow down. then go to conditional formatting and pick bagground color.
Pick the format style rules and add 2 new rules then pick the color you want when [Don’t feel overstressed color] has the value 1, 2 and 3
I hope this help. 🙂 - 10 months ago
Hi Mohan_Vanku
Download example PBIX with the code and data shown below
You can create a measure that generates the hex color code based on your rules about the values in relation to the Don't feel overstressed measure :
Matrix CF = SWITCH( TRUE(), [Sale inc Tax] > [Don't feel overstressed], "#FFF", //WHITE [Sale inc Tax] > [Don't feel overstressed] / 2, "#0F0", //GREEN "#F00" //RED )Then you select Conditional Formatting -> Backgroudn color from the drop down menu for the matrix values (note that I'm obviously using my own dummy data here)
In the CF settings, choose Format style -> Field value and then choose the measure just created Matrix CF as the field to decide the colors, click OK
You should see something like this. I've given the KPI an arbitrary value of 5
Regards
Phil
Hi Mohan_Vanku
Thank you for reaching out to the Microsoft Fabric Forum Community.
PhilipTreacy ThomasWeppler Thanks for the inputs.
I hope the information provided by users was helpful. If you still have questions, please don't hesitate to reach out to the community.
- Anonymous10 months agoNot applicable
Hi Mohan_Vanku
Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.