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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.