Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am using the built-in PowerBI Decomposition Tree visual. My data consists of three fields - A, B, C. Each field is comprised of 'Yes' or 'No'.
Within each field, I want 'Yes' to have a green bar and 'No' to have a red bar. The conditional formatting that I'm trying to apply appears to work at first glance. However, after going through potential scenarios, I realized that the formatting isn't correct.
Applied correctly:
All of the 'Yes' and 'No' have their proper color.
Applied incorrectly:
The 'No' in B is formatted green.
DAX Code:
This creates a Measure, which is used in the Conditional Formatting rule.
Conditional Formatting:
I have played around with the code and settings a little bit but can't find anything that will work. Am I doing something incorrectly or should I report this as a bug to Microsoft?
Thank you!
Hi @analyst7112 ,
After digging, I find the error is occured because if A is "NO" and B is "NO", then all values for C is "YES".
In this way, the measure will not analyze to the next level "B", all values suit the condition
A roughly but effective solution is add a row in the data source, A is "NO" and B is "NO" and C is "NO", but the count column is 0. I create a new sample to test and get the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Just following up again - is there any solution that doesn't require listing out all possible permutations? My data has 5 selections in each field, and there is 6 fields. 5^6 = 15625, which is largely impractical to list out for this data.
Is there any other option? I was using simplified data due to privacy concerns. However, instead of 'YES' or 'NO', there are actually 5 options per category. There are 5 categories total, so the number of permutations grows quite fast, and I'm not sure this option is feasible. Is there a better way to assign conditional formatting or a quicker workaround to the solution you described?
have you checked the values you are using? ie change it to a table or matrix to see what is happening. You dont have a catch in your switch statement, maybe, for your last statement put in another colour like orange or something maybe your values aren't not present so therefore it just defaults to green.
so after this line add
, "Orange")
Proud to be a Super User!
Unfortunately, adding a catch did not work. What analysis should I do on the table? This is what I'm seeing:
pleasse share your sample data and code in text
Proud to be a Super User!
https://drive.google.com/file/d/1h0VgiVHX8pNk3Rjb4lw5CiMA4Hv4j1Lk/view?usp=sharing
Here is the link to my PowerBI project. This is still the original poster - I had to create another account on here. Thank you for your help.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
122 | |
79 | |
49 | |
38 | |
31 |
User | Count |
---|---|
191 | |
78 | |
71 | |
50 | |
42 |