cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

New Member

## 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.

Thanks a lot.
1 ACCEPTED SOLUTION
Community Support

Hi @TR405 ,

1. below is my tets table

Table:

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

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.

2 REPLIES 2
Community Support

Hi @TR405 ,

1. below is my tets table

Table:

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

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.

Super User

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() ,

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors