Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone!
I need your help with a problem I have. What happens is that I need the bar to change color to green if it passes a target or constant value, or to change to red if it doesn't already arrive. attached photo of my graph
the idea is that after the intermittent line that comes out on the x-axis, it is the color change.
I'd be very grateful if you could help me.
Solved! Go to Solution.
Hi @CLCastroEn
I would use conditional formatting in this case with % TR values as a percentage above the limit.
Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!
Regards,
Pranit
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@CLCastroEn You could try this approach, which builds on a solution I did earlier.
Add a measure for each color you want:
[Measure Red] = if([Measure]<100,[Measure],blank())
[Measure Green] = if([Measure]>=100,[Measure],blank())
Now you put both of those measures in your bar chart, and then choose what color you want like you want each to be:
I hvae a PBIX here, and while you don't need the whole solution, you can use the measures for each color idea for your question: https://github.com/DataZoe/PBIX/blob/master/DonutShape.pbix
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@CLCastroEn , if you are not using legend and not using multiple measures. You can create a color measure and use conditional formating using "Field" Option.
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
refer:https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Hi @CLCastroEn
I would use conditional formatting in this case with % TR values as a percentage above the limit.
Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!
Regards,
Pranit
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
I don't understand, where do I find the conditional formatting? in my formatting tool does not appear.
You can write a measure like this that returns a result-dependent color value you can use in conditional formatting for your bar color.
Bar Color = IF([MyMeasure] > 1000, "Green", "Blue")
Then highlight your visual and in the Format options for your visual, hit the fx next to bar color and choose the measure you created.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks Pat.. This is very simple solution you gave.. Happy that its working from me. Thanks a lot.
This is my first solution ever worked and since i am writing it to you. 🙂
@mahoneypat hello! didn't work for me 😞 could you attach a screenshot of how to do it? Please
Highlight your bar chart, and then find the Data Colors section in the Format pane
Click on the fx, and pick Field Value and then the Bar Color Measure.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |