Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Conditional Coloring for Pie/donut Chart

Hi everyone.

 

I have a little problem, I have to create some donut chart, but the code colours should be based on the value of a field, these is the table:

ruz_lee_0-1610449519665.png

I have to create differents donut, one for each category, and the Average of rating by each category. The code colour should follow these rules:

If AVG(Rating)<5 then Red

If AVG(Rating) >=5  AND AVG(Rating)<8 Then Yellow

If AVG(Rating) >=8 Then Green

 

I think that I would need a calculated field with these rules, and add this field in the data colors of the object, but I can´t (or I don´t know) create a field calulated with AVERAGE function.

 

Any suggestion? Thanks a lot.

1 ACCEPTED SOLUTION

@Anonymous , check for custom visual. Standard visual not supported yet.

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , As far as I know, conditional formatting is not yet supported on the pie or any other visual that use a legend.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

And any suggestion to use like for example in the conditional formatting with the table object? As you know, a lot things is not possible to do it directly...

@Anonymous , with table visual you can create a color measure, like

Switch(True(),
AVG(Rating)<5 ,"red",
AVG(Rating)<8,"Yellow",
"Green"
)

 

Now in conditional formatting/ background color/ Data color, Under Fx option (Advance) option

Choose - Field value and use this measure.

 

Refer to these blogs for steps -

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

My video, that is for unichar and color - https://www.youtube.com/watch?v=veCtfP8IhbI

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Yes, but the problem is that the visual figure should be a pie or donut... 😞

@Anonymous , check for custom visual. Standard visual not supported yet.

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.