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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
charlie_torres
Frequent Visitor

Difference of days from today of multiple date columns in table

Hello @PBICommunity ,

 

As the newbie I am, I just found out that conditional formatting based on dates is not a thing in PBi. I understood from other posts that creating a numeric representation of the days' difference is needed and then applying the conditional on this. I believe there should be a clever way of creating a general measure, something like:
SELECTEDCOLUMN() - TODAY().
To apply the conditional without creating a measure for each column. Am I right? Does someone know the right approach here?
I am looking to apply a conditional to the table below:

 

charlie_torres_0-1676546107051.png

Something pretty easy in other platforms, but these don't have the functionality of PBI. Therefore will be great achiving this in Desktop:

 

(Looking for):

 

charlie_torres_1-1676546443295.png

 

Again as usual,

 

Thanks in advance

Charlie

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @charlie_torres ,

According to your description and screenshots, it seems that there are multiple date fields. And you want to set different background colors for these date fields when different conditions are met. You can refer the following links to try to achieve your requirement.

1. Select those date fields and unpivot these selected fields

Unpivot columns

yingyinr_1-1676875951944.png

2. Apply conditional formatting in your visual base on your requirement

Apply conditional formatting in tables and matrixes

yingyinr_2-1676876047750.png

 

Conditional formatting on multiple columns

 

If the above ones can't help you, could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, what kind of conditions are needed for different background colors? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
charlie_torres
Frequent Visitor

Hi @Anonymous 

 

Your suggestion is right what I was looking for. The shared links have been of great help, not only for this problem but for many other solutions.

Thanks very much.

 

Regards
Charlie

Anonymous
Not applicable

Hi @charlie_torres ,

According to your description and screenshots, it seems that there are multiple date fields. And you want to set different background colors for these date fields when different conditions are met. You can refer the following links to try to achieve your requirement.

1. Select those date fields and unpivot these selected fields

Unpivot columns

yingyinr_1-1676875951944.png

2. Apply conditional formatting in your visual base on your requirement

Apply conditional formatting in tables and matrixes

yingyinr_2-1676876047750.png

 

Conditional formatting on multiple columns

 

If the above ones can't help you, could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, what kind of conditions are needed for different background colors? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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