Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Everyone,
I have a requirenment to display a different color for bar based on the condition.
In the below screenshot the text Internal Audit (3rd line of Defense) is coming from Table 1, and the bar chart with Y axis values are coming from Table 2. The requirenment is to display Internal Audit (3rd line of Defense) ( 2nd bar) bar in any different color (for example red). I want to compare the texts from both the tables and the matched texts should show in different color.
Please find the below sample data. If we select the filter Company A then in the bar chart Internal Audit (3rd line of Defense) bar should higlight in diffent colour since the company A 's text value is Internal Audit (3rd line of Defense).
Table 1 | |
Text | Company |
Internal Audit (3rd line of Defense) | A |
Direct assistance | B |
Management testing | B |
Other (please describe) | C |
Table 2 | |
Text value | Measure |
Internal Audit (3rd line of Defense) | 10 |
Direct assistance | 20 |
Other (please describe) | 30 |
Please help me to achieve this.
Thanks in advance.
Solved! Go to Solution.
Try modifying the measure as
Measure 2 = IF ( VALUES ( Table2[Text value] ) IN VALUES ( Table1[Text ] ), "#6c1610" )
See the file attached as well
Hi Zubair Muhammad,
Thanks for ther reply. It is working for single text value. For company B there are two texts. If i select company B (Direct assistance,Management testing) both bars should highlight.
Try modifying the measure as
Measure 2 = IF ( VALUES ( Table2[Text value] ) IN VALUES ( Table1[Text ] ), "#6c1610" )
Sorry for hijacking the thread, but how do i make the highlight function work when all the values (text and measure) are in the sambe table?
Is it possible to format colors both by rules and field value together. The matched text bar should highlight the color based on the rules.
For example if we select gold color, the matched text bar should highlight in red color and remaining bars should be gold colors.
Sorry for late reply.
See if the attached file helps
You can create a small table defining colors and hex codes.
You can get codes from
https://www.w3schools.com/colors/colors_picker.asp
Now you can modify the MEASURE AS
Measure 2 = IF ( VALUES ( Table2[Text value] ) IN VALUES ( Table1[Text ] ), MIN ( Colors[HexCode] ) )
Thanks a lot for the solution.
Thanks a lot it worked.
Hi @Kavya123
you can Define a MEASURE like following and use it for conditional formatting
Measure 2 = IF ( SELECTEDVALUE ( Table2[Text value] ) = SELECTEDVALUE ( Table1[Text ] ), "#6c1610" )
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |