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
uayan
Frequent Visitor

Conditional formatting based on the column it comes from

I have 2 date column in the same table. 

Date 1Date 2 
01.02.2022     05.02.2022
 07.02.2022
03.07.2022     09.02.2022


I brought together these 2 column into single column in this condition. --> IF(Date 1=BLANK(), Date 2, Date 1)

 
And I want to add color based on the column it comes from. (such as date 1 = green, date 2= red)
 
Is that possible?
 
 
1 REPLY 1
pratyashasamal
Super User
Super User

Hi @uayan ,
Add another measure IF(Date 1=BLANK(), 2, 1)

Now go to Format for the visual >Visual >Cell Element > Select Date Column> Background Color (on)

Select Rules in the Format by field of the Background color or Font color dialogue box to format cell background or font color according to rules. Select the new measure field on which the formatting is based, and Summarization displays the field’s aggregate type.

Enter one or more value ranges and colors for each under Rules. There is an “If” value condition, a value condition, and a color for each value range. Each value range’s cell backgrounds or fonts are colored with the specified color.

pratyashasamal_0-1674488927002.png

You can also refer to this link to refer to steps for different types of conditional formatting :-
https://hevodata.com/learn/power-bi-conditional-formatting/#:~:text=To%20apply%20Power%20BI%20Condit....

 

Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





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

Proud to be a Super User!





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.