Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have a query relating to conditional formatting by row I have a screenshot here:
So the Unfavorable, Neutral, and Favorable are just 1 column (I used the count and then show value as a percentage of grand total.)
Naturally when the Favorable hits higher it shows as green but how do I make the Unfavorable responses to be red when it is higher? Since all 3 are just 1 column as shown in the conditional formatting:
Any help or solution would be appreciated! Kindly let me know if there are other details needed to achieve a solution.
Thank you so much! This is much appreciated. I will try this later on and will let you know the results. 🙂
Hi @RLSid17 ,
I have created a simple sample, please refer to it to see if it helps you.
Create 2 measures.
Measure =
VAR _count =
CALCULATE (
COUNT ( 'Table'[result] ),
FILTER (
ALL ( 'Table' ),
'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
&& 'Table'[result] = SELECTEDVALUE ( 'Table'[result] )
)
)
VAR _countsubject =
CALCULATE (
COUNT ( 'Table'[subject] ),
FILTER (
ALL ( 'Table' ),
'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
)
)
VAR _percent = _count / _countsubject
VAR _maxvalu =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
),
_percent
)
RETURN
_percent
Measure2 =
VAR _1 =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[subject] = SELECTEDVALUE ( 'Table'[subject] )
),
[Measure]
)
VAR _2 =
IF (
[Measure] = _1
&& MAX ( 'Table'[result] ) = "Unfavorable",
"Red",
IF (
[Measure] = _1
&& MAX ( 'Table'[result] ) = "Favorable",
"Green",
IF ( [Measure] = _1 && MAX ( 'Table'[result] ) = "Neutral", "Orange", BLANK () )
)
)
RETURN
_2
If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output with more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Sorry for the late response, I transformed my data and tried the second measure you provided and this was the result:
This almost works but is there a way for it to format the other columns (Neutral and Unfavorable? For some reason, it is only formatting the Favorable responses. Or rather, only the 1st column is picking up the formatting.
I'm using a Matrix for this to count each responses by column as seen above screenschot.
Hi @Anonymous
I have tried your solution, I think the color works but it is not the count of responses is not totaling to 100% similar to this where I count the 1 column and show value as a percentage of grand total (I used a matrix visual):
I have a workaround where I only change the color where the lower the value is the lighter the color and the higher the value the darker it gets:
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |