Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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
Hello, I have a simple problem - I have positive and negative returns for an Index... using Conditional formatting (measure), all my bars are blue, even though I have negative returns (sould be in Red)...
Can someone help me ?
Louis
Solved! Go to Solution.
HI @Louis66 ,
So in that case you need to modify your measure. Use SUM(Data[Returns]) in your condition in the measure.
You won't need a SELECTEDVALUE there. You can write your measure something like following:
Color =
VAR returns_value = SUM ( Data[Returns] ) // total value of the value used
RETURN
SWITCH (
TRUE (),
returns_value < 0, "#FF0000", // hexcode for Red color
"#0000FF" // hexcode for Blue color
)
I just wrote the DAX above on the fly, so check if there are any syntax errors.
HI @Louis66 ,
Few questions:
1. Is Color a measure that you have created?
2. On your visual if you represnting a column value, in your case Data[Returns], then it must have been summarised to SUM, AVERAGE, etc. But in your measure you are using the column value but not the one represented on your visual in my view.
Can you share screenshot around what you are displaying on your visual?
Hello Pragati, yes this is a measure I created, and yes I did use SUM for my returns... this is the screen shot.
... and my data :
It is the first time I have that kind of problem...
Louis
HI @Louis66 ,
So in that case you need to modify your measure. Use SUM(Data[Returns]) in your condition in the measure.
You won't need a SELECTEDVALUE there. You can write your measure something like following:
Color =
VAR returns_value = SUM ( Data[Returns] ) // total value of the value used
RETURN
SWITCH (
TRUE (),
returns_value < 0, "#FF0000", // hexcode for Red color
"#0000FF" // hexcode for Blue color
)
I just wrote the DAX above on the fly, so check if there are any syntax errors.
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 |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |