Forum Discussion
date interval ('>', '<')
Hi,
how can I add a filter with this kind of condition
date1 > 2022-03-31 and date2 < 2022-03-31
- Anonymous4 years ago
Hi Anonymous ,
Where would you like to use it?
1. You can add a filter to visuals, current page, and all pages.
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.
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 TeamIf 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
4 Replies
- amitchandakSuper User
Anonymous ,
Try like
filter(Table, Table[Date1] >date(2022,3,31) && Table[Date2] < Date(2022,3,31) )
- AnonymousNot 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?
- AnonymousNot applicable
Hi Anonymous ,
Where would you like to use it?
1. You can add a filter to visuals, current page, and all pages.
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.
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 TeamIf 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