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
KatkaS
Post Patron
Post Patron

Dates and comparing them, certain date of a month

Hello,

 

Could anyone please help me with following?

 

I have a table including column with a Date (approval Date of a certain report) and I need to do following:

1. add new column that would be 20th of the month of the approval date

2. add new column that would compare those two column and return following values:

  • LATE if the approval Date would be after 20th 
  • ON TIME if the approval Date would be before 20th

Thank you very much!!

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @KatkaS ,

 

Please check the formulas below.

Column 1 = STARTOFMONTH('Table'[date])+19
Column = IF('Table'[date]<='Table'[Column 1],"On time","Late")

1.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

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

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @KatkaS ,

 

Have your problem be solved? Please consider accept the answer as a solution if it worked.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
v-jayw-msft
Community Support
Community Support

Hi @KatkaS ,

 

Please check the formulas below.

Column 1 = STARTOFMONTH('Table'[date])+19
Column = IF('Table'[date]<='Table'[Column 1],"On time","Late")

1.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

Create a new column like

New date = date(year(table[approval Date]),month(table[approval  Date]),20)

take a diff

Days = datediff(table[approval  Date],table[New date],day)

Now using if on this column or on new column create the logic


Status= if (datediff(table[approval  Date],table[New date],day)>0, "Late","early")

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

EricHulshof
Solution Sage
Solution Sage

Do you really need step 1? Like elsewere in your report? because if not you can use this calculated column for step 2:

 

Column = IF(DAY('Table (3)'[Approval date]) > 20; "LATE" ; "ON TIME")

 

 


Quality over Quantity


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


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.