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
gdssiqueira
Helper I
Helper I

Filter on two conditions

Hi guys,

 

I want to filter a table by two values.

Suppose I have this schema:

 

Date  A

1/1    12

2/1    15

3/1    12

 

I want to remove rows in which (A < 15 AND the date is older than 3 days ago.) If it's less then 3 days ago, keep it, no matter what the value of A is.

 

What would you say is the best way to accomplish this?

 

Thanks!

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

In Edit Query:

 

= Table.SelectRows(#"Tipo cambiado", each ([Date] >= Date.AddDays(Date.From(DateTime.LocalNow()),-3)or [Value] >= 15) or [Date] >= Date.AddDays(Date.From(DateTime.LocalNow()),-3))

 

 




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

In Edit Query:

 

= Table.SelectRows(#"Tipo cambiado", each ([Date] >= Date.AddDays(Date.From(DateTime.LocalNow()),-3)or [Value] >= 15) or [Date] >= Date.AddDays(Date.From(DateTime.LocalNow()),-3))

 

 




Lima - Peru

Is there a way of running an OR conditional filter outside of a query? My case is as follows:

 

I have a report which requires conditional filters for some pages and not for others.

The conditional filter is as follows Column 1: contains "XXX" OR column 2: contains "YYY".

 

I understand I can create a query in the "Edit Queries" funtion to achieve this. My problem is that I need to use the same table without the queries on other pages of the same report. As far as I can see I need to create a duplicate sheet and then run the query on this sheet.

 

Is there an easier way?

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.