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
Anonymous
Not applicable

Conditional formatting based on date

Hello Everyone!

 

I am having some issues attempting to create a measure to conditionally format matrix columns based on date. 

 

Here is what I am trying to do:

In a Rolling 12 Month Sales visual, I would like to shade all cells where the month/year is before the Client's Go-Live Date, which in my visual ideally would look like this:

 

Conditional formatting 2.jpg

 

I created the following measure:

 

Before Go-Live = IF(MIN('Calendar'[Date])<MAX('Sales'[Actual Go-Live]),0,1)

And then set up the conditional formatting this way:

 

Confitional formatting 3.jpg

 

But the cells being shaded are those with a value only, and only in the same Month/Year as the client's Go-Live date. The preceding blank cells are not shaded. Here is the result when I turn it on:

 

Conditional formatting.JPG

 

How do I get all cells prior to the client's Go-Live date shaded?

 

Thank you!

 

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

It seems that your measure didnt return a true value,can you show me your .pbix file?If it's not convenient ,can you take a screenshot of the columns which you put in the matrix visual?

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

@v-kelly-msft 

Hi Kelly! I am unable to share the pbix but here are some screenshots. The rows/columns/values for the matrix, the tables used, the relationship and the First 12 measure used in the table. Hope this helps, it is all I can provide. I appreciate it!

 

Columns.jpg

 

Calendar table.jpg

 

clients table.jpg

 

sales table.jpg

 

relationships 2.jpg

 

first 12 measure.jpg

 

MFelix
Super User
Super User

Hi @Anonymous ,

 

Believe this is related with the fact that you have blanks and not 0 try to add a +0 to your measure and check if it works properly.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix Thanks for the reply! I am not sure what you mean though: where exactly in the measure do I add "+0"?

 

Thank you!

@Anonymous .

 

Try to redo your measure

 

Before Go-Live = IF(MIN('Calendar'[Date])<MAX('Sales'[Actual Go-Live]),0,1) + 0

 

Be aware that not really sure if this will work, if you can share a sample file if it doesn't work would be helpfull to give you the correct answer.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix  Ah I see. I gave this a try and nothing changed. Unfortunately I do not have a sample file that I am able to share at this time but I will try to get something put together that is shareable. Thank you for your help!

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.