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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors