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

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.

Reply
Nun
Resolver I
Resolver I

Conditional formatting color based on the month

Hello,

I am using a line chart as visualitation. Axis there are category and Month (Jan, Feb, Mar...). Values are the quantities of each category. I try to format Data label with a formula. The formula I try to create is that the label to show is only the only value in a specific month. For example if the month is Oct show the label (color code black), otherwise, the label will have a color code trasparent.  I try different solution, but I get an error "A table of multiple values was supplied.."

Thank you! 

3 REPLIES 3
amitchandak
Super User
Super User

@Nun , It should be a measure like this and should be used with filed value option

 

Color = Switch(True() ,

max(Date[Month Year]) =  "Oct-2021", "#000000",

"#FFFFFF00")

 

Use this in conditional formatting with the field value option

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Hi,

thanks for the quick reply.

I used this formula: 

Color = Switch(True() ,

max('Calendar'[Month]) = "OCT", "#000000",

"#FFFFFF00"), and applied it in the field value option. But all the labels are transparent. The category is in another table. I created a relationship within the table "Calendar" and month column (JAN, FEB..) and table item so period column (Jan, Feb...). Thanks!

Hi,

I understood the reason of all the values formatted are trasparent: max takes SEP as max (alphabetic order) and so all the labels are trasparent. Are all trasparent, because the true is based on the months, when it should consider the values too. I believe it is needed a formula, that is true a value in a specific month, so only that value, in a specific month, will be formated as black and the other values as white. Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors