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
NickzNickz
Helper IV
Helper IV

Latest Submission Date VS Current Month

Hi ...

 

In my table, I have a column name Submission Date (Ex. Mac 2023).

 

NickzNickz_1-1684742261677.png

First I believe we need to create a measure for Month = Current Month - 1 Month.
Secondly, I need to create a measure for the Submission Date Indicator =

If Submission Date >= Month then the background colour is green.
If Submission Date < Month, the background colour is red.

 

Hope someone can help me with this. Your help is much appreciated.

 

Regards,

NickzNickz

 

 

 

 

1 ACCEPTED SOLUTION

Hi @NickzNickz ,

Can you try below updated DAX for Background color field as listed in above steps:

Background Color = IF(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1)>= DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1), "Green",if(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1) < DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1),"Red",""))
 
This will result as follows:
 
SamInogic_1-1684758401549.png


If this answer helps, please mark it as an Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

View solution in original post

4 REPLIES 4
SamInogic
Super User
Super User

Hi @NickzNickz ,

As per our understanding your requirement is to conditionally format the column’s background if the Submission date is greater than current month/Year to Green otherwise if the Submission date is older than the current month/year then colour should be red.

You can achieve this by following below steps:

1. Create a column in the table with below DAX expression:

Background Color = IF(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1)>= DATE(YEAR(TODAY()), MONTH(TODAY()), 1), "Green",if(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1) < DATE(YEAR(TODAY()), MONTH(TODAY()), 1),"Red",""))

 
2. You can optionally create a column to show only Month and Year of the Submission Date with below DAX expression:

Submission Month And Year = FORMAT(Submission[Submission Date].[Date], "mmm") & " " & YEAR(Submission[Submission Date].[Date])

3. Add these columns to the table as shown in the below screenshot.

 Frm 1.png

4. Now to add conditional formatting to the column you can click on respective column i.e. Submission Date and select conditional Formatting option and click on Background color. Please refer to the below screenshot for the same.

 Frm 2.png

 5. This will open a dialog box where you need to select the field Background Color that we created and click on OK.

 Frm 3.png

6. This will result as follows as per the requirement.

 
Frm 4.png

 

If this answer helps, please mark it as an Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Hi @SamInogic ,

 

First of all I am very grateful for your efforts and time...

 

I have tested in my development enviroment and I found out that, April 2023 still red (as result below) ... April 2023 suppost to be green also because current month we need to minus 1 month ...

Formula : Month = Current Month - 1 Month 
Answer : Month = April 2023


How can we achieve that  .....

 

NickzNickz_1-1684754491914.png

 

 

Regards,

NickzNickz

 

 

 

 

Hi @NickzNickz ,

Can you try below updated DAX for Background color field as listed in above steps:

Background Color = IF(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1)>= DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1), "Green",if(DATE(YEAR(Submission[Submission Date].[Date]) , MONTH(Submission[Submission Date].[Date]), 1) < DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1),"Red",""))
 
This will result as follows:
 
SamInogic_1-1684758401549.png


If this answer helps, please mark it as an Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Hi ... 
Dear @SamInogic ,

 

Thank you for your prompt  reply.

 

I have tested and its was great .... 

NickzNickz_0-1684760122501.png

 

Thank you so much ...

 

Regards,

NickzNickz

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.

Top Solution Authors