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
rpinxt
Impactful Individual
Impactful Individual

Can't get my conditional formatting to work

I have this simple matrix :

rpinxt_0-1710764196544.png

Now I want to do something with the hours above 20.

Hours in the field you can put conditional formatting on but somehow I cannot find a field to use in this box :

rpinxt_1-1710764313819.png

I would think the field would be hours because that is the field I want collored base on its value....

 

 

 

1 ACCEPTED SOLUTION

Understood @rpinxt , create one new column which will have only hours from this time column with the help of below syntax: 

New Column = HOUR('Material Document'[Hours])
Then use this new column for the conditional formatting rules based. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

View solution in original post

6 REPLIES 6
Kishore_KVN
Super User
Super User

Hello @rpinxt  in this case you should not choose Field Value. You have to choose Rules option and then provide the conditions on Hours column then it will fulfil your requirement. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

rpinxt
Impactful Individual
Impactful Individual

Thanks @Kishore_KVN but unfortunately not:

rpinxt_0-1710767612618.png

Still cannot choose the field Hours in here.

 

Hello @rpinxt What is the data type of the hour column check it first. It has to be a number and then select it here in the rules. Also you have to select number in both the places instead of percentage and number then only it will start reflecting. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

rpinxt
Impactful Individual
Impactful Individual

Well @Kishore_KVN  it is a time format :

rpinxt_0-1710926679568.png

 

It reflects hours between 2 timestamps so it cannot be just a number.

If I set it to number than the field makes no sense anymore.

This calculated field is the result of 2 day/time fields subtracted.

 

Understood @rpinxt , create one new column which will have only hours from this time column with the help of below syntax: 

New Column = HOUR('Material Document'[Hours])
Then use this new column for the conditional formatting rules based. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

rpinxt
Impactful Individual
Impactful Individual

Thanks @Kishore_KVN this did the trick.

Made a new measure like you said and used that field (which is number format) for the conditional formatting.

Works great.

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.