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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
learner03
Post Partisan
Post Partisan

Conditional formatting based on rules and colors

i Have following sample data-

Name timestamp Work Area order picks
abc 10-Feb A 2
abc 10-Feb B 3
abc 10-Feb A 2
abc 11-Feb A 3
dec 10-Feb A 2
dec 11-Feb C 4
dec 12-Feb C 5
dec 10-Feb A 3
ded 11-Feb B 4
ded 11-Feb C 5
ded 12-Feb C 1
ded 12-Feb B 5
fds 10-Feb A 6
fds 11-Feb B 2
fds 11-Feb C 3
fds 11-Feb B 6

and the output is as below based on sum of order picked by each person for the different dates-

akapoor03_0-1677035617114.png

I need to do conditional formatting on the order sum numbers based on in which area the person worked. If the person worked only in "A" area for that particular day then text as red, If it worked in "A" and any other area then Blue and if not in "A" then Green.

The sum of order is a measure as SUM(Table[order picks]).

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@learner03 , Create a measure like

color  =

var _m1 = calculate(distinctcount(Table[Work Area]) )

var _m2 = calculate(distinctcount(Table[Work Area]), filter( Table,Table[Work Area] = "A") ) 

return

if(_m1 -_m2, "Red", "Blue")

 

Use in conditional formatting using field value option

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

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://dropmefiles.com/GAoVf
Screen Capture #354.png

you can write measure like this
Screen Capture #355.png

View solution in original post

6 REPLIES 6
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://dropmefiles.com/GAoVf
Screen Capture #354.png

you can write measure like this
Screen Capture #355.png

Ahmedx
Super User
Super User

for some reason it seems to me that it should look like the one below in my screenshot, or did I not understand something?!
Screen Capture #348.png

@Ahmedx Yes, what's the approach?

amitchandak
Super User
Super User

@learner03 , Create a measure like

color  =

var _m1 = calculate(distinctcount(Table[Work Area]) )

var _m2 = calculate(distinctcount(Table[Work Area]), filter( Table,Table[Work Area] = "A") ) 

return

if(_m1 -_m2, "Red", "Blue")

 

Use in conditional formatting using field value option

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

@amitchandak I have sorted this taking your lead. Thnanks for this

@amitchandak thanks but I have 3 cases- worked only in "A", worked in "A" and any other area and third is worked in area other than "A"

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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