Forum Discussion
Conditional format on matrix table
- Anonymous2 years ago
Your solution is great, johnbasha33 . It worked like a charm!
Hi, Cheng2202
Have you already solved the current problem? I tried the workaround of johnbasha33 using the following sample data and it worked
I have the following table visual, and then I create one measure using the following DAX expression:
icon color = SWITCH(TRUE(), [Profit]*0.1>=[Input],"green", [Profit]>0&&[Profit]*0.1<[Input],"yellow", "red")Set the conditional formatting as follows:
Here are the results:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous Is it possible to remove where it says yellow? 🤔
Hi Cheng2202
Thank you for your reply, you can remove the yellow from the totals row. You need to use the ISINSCOPE or HASONEVALUE function to determine whether the current row is a total row.
HASONEVALUE function (DAX) - DAX | Microsoft Learn
ISINSCOPE function (DAX) - DAX | Microsoft Learn
Here's a reference for using them to remove totals:
Just change the DAX expression in the image to:
icon color = IF(
ISINSCOPE('Table'[Product]),
SWITCH(TRUE(),
[sales amount]>=300,"green",
[sales amount]>=200,"yellow",
"red"
)
)
Here's what it looks like:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.