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

Using OR condition between slicers to filter a table

Hi,

 

I have two slicers:
The first one filter the severity of a task and the second one the priority.
Both filter are a column of the table I want to filter.

When we filter a table with two slicer a && is applied on the table we want to filter. As an example, If I select severity 2 on the first slicer and priority 1 on the second, I will have all task with severity 2 && priority 1.
What I would like is all task with severity 2 || priority 1


Here is an illustration:
Untitled.png

Namepriorityseverity
AA15
BB23
CC13

 

If I select severity 2 and priority 3, I would like to see the task BB and CC and not only BB

Thanks in advance
Regards

1 ACCEPTED SOLUTION

Hi @Cydevos 

Calculated table is static so it can't change based on slicers.

You could create tables which has no relationship with others.

priority = VALUES('Table'[priority])

severity = VALUES('Table'[severity])

Create a measure and add it to the visual level filter

Measure =
VAR s1 =
    CONCATENATEX ( priority, [priority], "," )
VAR s2 =
    CONCATENATEX ( severity, severity[severity], "," )
RETURN
    IF (
        SEARCH ( MAX ( 'Table'[priority] ), s1, 1, 0 ) > 1
            || SEARCH ( MAX ( 'Table'[severity] ), s2, 1, 0 ) > 0,
        1,
        0
    )

Capture11.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Cydevos ,

calculate([Measure], filter(all(Table),Table[priority] in allselected(Table[priority]) || Table[severity] in allselected(Table[severity]))
or
calculate([Measure], filter(all(Table),Table[priority] in values(Table[priority]) || Table[severity] in values(Table[severity]))

Hi,

Thanks for your answer.
What should I put in [measure] ? 

Hi @Cydevos 

[Measure]is the measure you create.

for example: Measure1=count(table[column])

the use the [Measure1] in the formula @amitchandak  provided.

 

Could you check if any answer solve your problem?

As tested, AntrikshSharma's link is very helpful to this problem.

If it is not sloved, please share the problem with details here.

 

Best Regards

Maggie

AntrikshSharma
Community Champion
Community Champion

Hi,

 

Sorry for the late asnwer. This article is really usefull. My problem is that I don't need to calculate anything, 

I just want the query to return me a table with all column selected by both filter

 

Regards

Hi @Cydevos 

Calculated table is static so it can't change based on slicers.

You could create tables which has no relationship with others.

priority = VALUES('Table'[priority])

severity = VALUES('Table'[severity])

Create a measure and add it to the visual level filter

Measure =
VAR s1 =
    CONCATENATEX ( priority, [priority], "," )
VAR s2 =
    CONCATENATEX ( severity, severity[severity], "," )
RETURN
    IF (
        SEARCH ( MAX ( 'Table'[priority] ), s1, 1, 0 ) > 1
            || SEARCH ( MAX ( 'Table'[severity] ), s2, 1, 0 ) > 0,
        1,
        0
    )

Capture11.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.