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
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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
charlie_torres
Frequent Visitor

Hi @v-yiruan-msft 

 

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

v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.