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
dferry
Helper I
Helper I

Assign Colors to results

I have a table with five columns.  Invoice No., Work Order No., Date, Labor and Technician.  There is a column in the Data Model that is not part of my table call OFT_ID.   This OFT_ID is a number that tells me information if the work order is  Customer Billable, Warranty Work Order, Rental Work Order, etc.  If the OFT_ID is 477, 478, 479 or 480 then make the labor amount in the table "Red", if not then "White".  By making the labor Red my users will know that the work  order is a Warranty Work Order and they won't have to look at every single Work Order in our sytem to determine which ones are Warranty.  I only have these five columns becuase they use this report on there phones and not enough space to put the OFT_ID next to the work order.

Thanks,

DougColor-Labor.jpg

1 ACCEPTED SOLUTION

Hi @dferry 

 

What is the data type of your "oft_id" column? In my sample, it is of Whole number type, so I can use {477, 478, 479, 480}. If this column is of Text type, you need to use double quote to surround the values like {“477”, ”478“, ”479“, ”480“}. I include both samples in the attached pbix file. 

vjingzhang_1-1656062574562.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

 

View solution in original post

11 REPLIES 11
dferry
Helper I
Helper I

Dummy DataDummy Data

Hi @dferry 

 

What is the data type of your "oft_id" column? In my sample, it is of Whole number type, so I can use {477, 478, 479, 480}. If this column is of Text type, you need to use double quote to surround the values like {“477”, ”478“, ”479“, ”480“}. I include both samples in the attached pbix file. 

vjingzhang_1-1656062574562.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

 

It worked!  You are awesome.  Thank you very much.

I have it as Text.

Hi @dferry 

I have a sample of Text column in my previous reply's attached pbix file, have you downloaded that pbix and tried it? 

v-jingzhang
Community Support
Community Support

Hi @dferry 

 

Assume your data is like below

vjingzhang_0-1655454290770.png

 

You can create a measure for conditional formatting,

Color Measure = IF(SELECTEDVALUE('Table'[OFT_ID]) IN {477, 478, 479, 480}, "Red", "White") 

 

When set the conditional formatting, choose Format style on Field value based on above measure. I take background color for example. You can format others with the same method. https://docs.microsoft.com/power-bi/create-reports/desktop-conditional-table-formatting 

vjingzhang_1-1655454499362.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Thank you for helping.  I have followed your instructions but when i go to format the Measure "Color" is greyed out and it will not let me select it.

Color-Labor-2.jpg

Hi @dferry 

 

Can you show the code of the Color measure you used? Is it possible to provide a sample pbix file (removing sensitive data) so I can look into it directly?

 

Jing

Color_Measure.jpg

Hi @dferry 

 

Can you add [oft_id] column and this color measure to the table visual to show what values they return for every row currently? We need to see their returned values to know whether they are getting correct results.

 

Or can you show how the source table looks like with some dummy data? Is it similar to the assumption in my first reply? I can make a demo based on the dummy data then. 

 

Jing

Color_Measure_with_OFT_ID.jpg

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