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
BDIAZCUSI
Frequent Visitor

Create New Filter With OR option between to columns

Hi Gurus, 

I'm New with power bi and I have an issue with filtering a Table. 

I want the user to be able to filter de report like this. 

 

Select Fields

from Table t

where t.Date1 = "Date selected on filter1"

OR t.date2 = "date selected on filter 2"

 

Currently I'm not being able to create a data Slicer or a filter in the report that could do this with an OR condition.

 

Do any one have an idea if I'm missing any functionality or component?

 

This is what I need to achieve. 

As you can see, the fields that start with "FECHA" are dates as an internal code. But this is the result I need. 

I filter FECHA_VCTO1_C1 = 33035 OR FECHA VCTO1_C2 = 33035

 

Please, let me know if I'have to be more specific.

BDIAZCUSI_1-1650479567242.png

 

Regards

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @BDIAZCUSI 

Please make the following changes in your original pbix:

1.create seperate tables for field 'FECHA_VCTO1_C1' and field ‘FECHA VCTO1_C2 

calculated table:

slicer1 = VALUES('Table'[FECHA_VCTO1-C1])
slicer2 = VALUES('Table'[FECHA_VCTO1-C2])

2. add a measure as below and apply it to visual filter pane

filter = 
VAR condition1 =
    IF (
        MAX ( 'Table'[FECHA_VCTO1-C1] ) = SELECTEDVALUE ( 'slicer1'[FECHA_VCTO1-C1] ),
        1,
        0
    )
VAR condition2 =
    IF (
        MAX ( 'Table'[FECHA_VCTO1-C2] ) = SELECTEDVALUE ( 'slicer2'[FECHA_VCTO1-C2] ),
        1,
        0
    )
RETURN
    IF ( condition1 + condition2 > 0, 1, 0 )

1.png

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @BDIAZCUSI 

Please make the following changes in your original pbix:

1.create seperate tables for field 'FECHA_VCTO1_C1' and field ‘FECHA VCTO1_C2 

calculated table:

slicer1 = VALUES('Table'[FECHA_VCTO1-C1])
slicer2 = VALUES('Table'[FECHA_VCTO1-C2])

2. add a measure as below and apply it to visual filter pane

filter = 
VAR condition1 =
    IF (
        MAX ( 'Table'[FECHA_VCTO1-C1] ) = SELECTEDVALUE ( 'slicer1'[FECHA_VCTO1-C1] ),
        1,
        0
    )
VAR condition2 =
    IF (
        MAX ( 'Table'[FECHA_VCTO1-C2] ) = SELECTEDVALUE ( 'slicer2'[FECHA_VCTO1-C2] ),
        1,
        0
    )
RETURN
    IF ( condition1 + condition2 > 0, 1, 0 )

1.png

Best Regards,
Community Support Team _ Eason

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.

Top Solution Authors
Top Kudoed Authors