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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Date is greater than if formula

Hi, 

 

I am trying to filter out rows, that have

a) the Clearance date value not blank

b) the Clearance date must be after 2022-09

 

I tried using this formula:

Clearance date Filter = if(ISBLANK(QAR_db_31_10[Clearance date]),"DO NOT DISPLAY", if(QAR_db_31_10[Clearance date]>2022-9, "DISPLAY", "DO NOT DISPLAY"))
 
While it seems to be able to filter out the blank cells, it does not work for the date after 2022-09.
 
Could anyone please help me out?
 
Thanks a lot.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my tets table

Table:

vbinbinyumsft_0-1669020122634.png

2. create a measure with below dax formula

Measure =
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR cur_year =
    YEAR ( cur_date )
VAR cur_month =
    MONTH ( cur_date )
RETURN
    IF (
        ISBLANK ( cur_date )
            || AND ( cur_year = 2022, cur_month <= 9 ),
        "Do not display",
        "Display"
    )

3. add a table visual with field and measure

vbinbinyumsft_1-1669020236229.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my tets table

Table:

vbinbinyumsft_0-1669020122634.png

2. create a measure with below dax formula

Measure =
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
VAR cur_year =
    YEAR ( cur_date )
VAR cur_month =
    MONTH ( cur_date )
RETURN
    IF (
        ISBLANK ( cur_date )
            || AND ( cur_year = 2022, cur_month <= 9 ),
        "Do not display",
        "Display"
    )

3. add a table visual with field and measure

vbinbinyumsft_1-1669020236229.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous ,

 

Clearance date Filter = if(ISBLANK(QAR_db_31_10[Clearance date]),"DO NOT DISPLAY",

if(QAR_db_31_10[Clearance date]> date(2022,09,01) , "DISPLAY", "DO NOT DISPLAY"))

 

You can use date(2022,09,30)  if needed

 

Also consider switch(True() ,

 

Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors