Forum Discussion
cell formatting in matrix based on row/column - error assigning measure to conditional formatting
- Anonymous1 year ago
Hi jstanley1017 ,
Please refer to the following steps.The measure is as follows.
color = var row_selection = (SELECTEDVALUE(Tiering[Tier],1)) VAR column_selection = SELECTEDVALUE(Res[Resiliency],1) RETURN SWITCH(TRUE(), column_selection IN {"AA","RR"},"Green", column_selection="AS",IF(row_selection IN{"Tier 1","Tier 2"},"Yellow","#CCFF66"), column_selection="AP",IF(row_selection IN{"Tier 1","Tier 2","Tier 3"},"Yellow","#CCFF66"), column_selection="ND",IF(row_selection IN {"Tier 1","Tier 2","Tier 3", "Tier 4" },"Red", IF(row_selection = "Tier 5","Gray","#FFFFFF") ), "#FFFFFF" )Use the measure as the background formatting for the matrix values. And the final result is as follows.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You are doing integer conversions on text values.
Your logic can also be simplified by using validity ranges rather than specifying every single combination.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523