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
Anonymous
Not applicable

date interval ('>', '<')

Hi,

how can I add a filter with this kind of condition

date1 > 2022-03-31 and date2 < 2022-03-31

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Where would you like to use it?

 

1. You can add a filter to visuals, current page, and all pages.

vcgaomsft_3-1656037557469.png

Add a filter to a report in Power BI - Power BI | Microsoft Docs

 

2. You can also create two slicers and drag the two date columns into the slices.

vcgaomsft_4-1656037719926.png

Slicers in Power BI - Power BI | Microsoft Docs

 

3. In a formula, you can add code like this in place of the filter parameter of the formula, e.g.

Measure =
CALCULATE(
SUM('Table'[Value]),
FILTER(ALL('Table'),'Table'[Date1]>DATE(2022,3,31)&&'Table'[Date2]<DATE(2022,3,31))
)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous ,

Try like 

filter(Table, Table[Date1] >date(2022,3,31) && Table[Date2] < Date(2022,3,31) )

Anonymous
Not applicable

Thanks @amitchandak 

is it a DAX measure ? sorry to ask basic question but how can I implement it to have the filter in the dashboard/report?

Hi @Anonymous ,

 

Where would you like to use it?

 

1. You can add a filter to visuals, current page, and all pages.

vcgaomsft_3-1656037557469.png

Add a filter to a report in Power BI - Power BI | Microsoft Docs

 

2. You can also create two slicers and drag the two date columns into the slices.

vcgaomsft_4-1656037719926.png

Slicers in Power BI - Power BI | Microsoft Docs

 

3. In a formula, you can add code like this in place of the filter parameter of the formula, e.g.

Measure =
CALCULATE(
SUM('Table'[Value]),
FILTER(ALL('Table'),'Table'[Date1]>DATE(2022,3,31)&&'Table'[Date2]<DATE(2022,3,31))
)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

Thanks Gao

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.