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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Determine if 2 date columns are before today and before end of the next month in Power BI / DAX

I have 2 columns that includes 2 different dates.

 

What i'm trying to do is to create a calculated column that determines whether column "governance" is <= TODAY and the "contract issue" column is <= the end of the next month (i.e. March). with either "yes" or "no" in the if statement.

 

Sample table below

 

Governance    Contract Issue
14/01/2022   04/03/2022
04/02/202211/03/2022
  

 

Much thanks in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a calculated column as below to get it:

Flag = 
VAR _today =
    DATE ( 2022, 2, 25 )
RETURN
    IF (
        'Table'[Governance] <= _today
            && 'Table'[Contract Issue]
                >= EOMONTH ( _today, 0 ) + 1
            && 'Table'[Contract Issue] <= EOMONTH ( _today, 1 ),
        "yes",
        "no"
    )

yingyinr_0-1646113031378.png

Best Regards

View solution in original post

4 REPLIES 4
tackytechtom
Super User
Super User

Hi @Anonymous ,

 

How about this:

IF (
    'Table2'[Govnernance] <= TODAY() && 
    'Table2'[Contract Issue] <= EOMONTH ( Today(),  1 ) &&
    'Table2'[Contract Issue] >  EOMONTH ( Today(), 0 ),
    "yes",
    "No"
) 

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tackytechtom
Super User
Super User

Hi @Anonymous ,

 

How about this:

IF (
    'Table'[Governance] <= TODAY() && 'Table'[Contract Issue] <= EOMONTH ( Today(), 1 ),
    "yes",
    "No"
)

 

Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Hi @tackytechtom 

 

thank you for the quick response. i've tried it but it returns me all "contract issue" that's happened before the end of the next month (even in the past) what i was looking for was the contract issue dates between the start of next month and the end of next month (i.e. only all march dates only)

Anonymous
Not applicable

Hi @Anonymous ,

You can create a calculated column as below to get it:

Flag = 
VAR _today =
    DATE ( 2022, 2, 25 )
RETURN
    IF (
        'Table'[Governance] <= _today
            && 'Table'[Contract Issue]
                >= EOMONTH ( _today, 0 ) + 1
            && 'Table'[Contract Issue] <= EOMONTH ( _today, 1 ),
        "yes",
        "no"
    )

yingyinr_0-1646113031378.png

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.