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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Problem with a Measure Used for Conditional Formatting

Please help!

 

I successfully used the following measure for backgorund conditional formatting:

 

Color Measure = Switch(true(), MAX('WTCV'[OBL %]) >=.98 , "light green",
MAX('WTCV'[OBL %]) >=.92 , "yellow",
MAX('WTCV'[OBL %]) >=0 , "red"
)
 Used it as Field Value this way:
ZiaAnderson_0-1620321170897.png

It works fine, no problem.

On another tab I have a nearly identical viasual, using nearly identical Excel file. So I set up another measure:

 

Obs Color Measure = Switch(true(), MAX('RDTE'[OBL %]) >=.98 , "light green",
MAX('RDTE'[OBL %]) >=.92 , "yellow",
MAX('RDTE'[OBL %]) >=0 , "red"
)
 
However, when I try to use it for conditional formatting, I am unable to select it. Please tell me what am I doing wrong.
Untitled.jpg
1 ACCEPTED SOLUTION

@Anonymous 

 

1. this is how i created measure in this case

 

Color Measure = Switch(true(), MAX('Table'[OBL %]) >=.98 , 1,
MAX('Table'[OBL %]) >=.92 , 2,
MAX('Table'[OBL %]) >=0 , 3
)
 
2. then i used it in the conditional formatting like below
 
negi007_0-1621001133837.png

 

3. below is the output

negi007_2-1621001164320.png

 

 

I am also attaching pbix file for your. there are two measure in the file for background color based on condition.

 

let me know if it helps you. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

7 REPLIES 7
negi007
Community Champion
Community Champion

@Anonymous there is another way of creating measures.If possible, please try below option instead of hard coding the color, use 1,2, 3 . Then instad of field value use rules in your conditional formatting. Please refer to below screenshot. This will also give you more control on the color scale you wish to use.

 

Color Measure = Switch(true(), MAX('WTCV'[OBL %]) >=.98 , 1,
MAX('WTCV'[OBL %]) >=.92 , 2,
MAX('WTCV'[OBL %]) >=0 , 3
)

 

 

negi007_0-1620875243358.png

Do let me know if you still face any issue.

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

@negi007 Thank you! This sounds like a great method, however, I am not sure how you are using the measure in this case.

@Anonymous 

 

1. this is how i created measure in this case

 

Color Measure = Switch(true(), MAX('Table'[OBL %]) >=.98 , 1,
MAX('Table'[OBL %]) >=.92 , 2,
MAX('Table'[OBL %]) >=0 , 3
)
 
2. then i used it in the conditional formatting like below
 
negi007_0-1621001133837.png

 

3. below is the output

negi007_2-1621001164320.png

 

 

I am also attaching pbix file for your. there are two measure in the file for background color based on condition.

 

let me know if it helps you. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

v-luwang-msft
Community Support
Community Support

Hi  @Anonymous ,

About share pbix file ,you could read the following article:

https://community.powerbi.com/t5/Desktop/How-to-upload-PBI-in-Community/m-p/1672886 

 

Best Regards

Lucien

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Could you pls share your pbix file? Remember to remove condient data.

 

Best Regards

Lucien

amitchandak
Super User
Super User

@Anonymous , Yiu can face issues when you do have text type of measure.  Just try to type Obs in search and then try to select.

or

 Can you share a sample pbix after removing sensitive data.

Anonymous
Not applicable

@amitchandak 

ZiaAnderson_0-1620323013908.png

Still doesn't recognize the measure. May I send you the pbix via messenger?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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