cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper II

## Visual level filters - How to filter 3 fields using And OR operator

Hi all,

In my reports (using table to display data), i have 3 fields (A, B and C). I want to filter data like:

(A = 1 or B = 2) and C = 3

How can i do that?

1 ACCEPTED SOLUTION
Employee

Hi @hellgoingon,

We are not able to directly use Visual level filters to achieve your requirement. In your scenario, you can create a calculated table using the following formula and then create a table visual using the new created table.

Table = CALCULATETABLE(Table1, FILTER(Table1,(Table1[A]=1||Table1[B]=2)&&(Table1[C]=3)))

For more details, you can review this attached PBIX file.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Frequent Visitor

How would this work if the values in the comparison were dynamic (i.e. user provided) rather than static?

A better example for this case may be a fact table of events with columns: Event_Name, Start_Date, End_Date. You have this fact connected to a Date dimension table on either Start_Date or End_Date. In your report, you have a slicer based on the Date.Month where a user can select one or more months, and in the report we want to see all events where the Start_Date OR the End_Date in in the selected months.

Employee

Hi @hellgoingon,

We are not able to directly use Visual level filters to achieve your requirement. In your scenario, you can create a calculated table using the following formula and then create a table visual using the new created table.

Table = CALCULATETABLE(Table1, FILTER(Table1,(Table1[A]=1||Table1[B]=2)&&(Table1[C]=3)))

For more details, you can review this attached PBIX file.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Helper II

It worked. Thanks

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors