Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Colour Conditional Formating
11-22-2023
02:35 AM
Hi all,
I am new to Power BI and I am trying to create a graph that drills down from month to days to PCN to Practice - (I am working in healthcare). I have done this however I need to match the Practice and PCN to their individual colours.
I have managed to set up data sheet and a Measure which pulls these however when there is more than one practice in the PCN, it does not return the correct PCN colour. Therefore I need to set up a Measure which explain that if more than one practice is returned, choose the colour of the practice.
So far I have this:
Data Color Admin =
lookupvalue(
'PCN & Practice colour'[Colour],
'PCN & Practice colour'[Practice],
SELECTEDVALUE('BP Admin Calls'[Registered practice]),
"#374A92")
If you can help, this will save me more hours of research!
Thank you
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023
01:44 PM
this is what i meant by formatting the values based on heirarchy with HASONEVALUE() - except, just replace Orange with the rules you need for when there's more than 1 practice.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023
01:44 PM
this is what i meant by formatting the values based on heirarchy with HASONEVALUE() - except, just replace Orange with the rules you need for when there's more than 1 practice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023
01:08 AM
Great - thanks so much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023
02:12 PM
As you've noticed, the issue arises when there's more than 1 practice - and this is because the SELECTEDVALUE() function returns a blank in that case, so the lookup fails. One way around this is by wrapping your lookup in HASONEVALUE() - i.e:
Data Colour Admin = IF(HASONEVALUE(Table[Practice]),
// simply look up the colour...,
// else, your fallback logic here
)

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
02-09-2025 02:16 AM | |||
01-10-2025 06:39 AM | |||
Anonymous
| 06-21-2021 08:23 AM | ||
12-13-2024 12:02 PM | |||
10-23-2024 09:02 AM |
Top Solution Authors (Last Month)
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |