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

Filter or Slicer with OR

I would like to ask if there's any way to create a slicer or page/visual filter that allows us to use OR. For example, imagine I have a table with data from each phone call a business has had. They are divided by inbound calls and outbound calls in the [Type of phonecall] and then they are divided by campaigns. I have a page dedicated to inbound calls in which I have a page filter which is Type of phonecall is "Inbound call". Up to now everything alright, the problem is that there are two campaigns in which I'm asked to ignore whether the calls are written down as inbound or outbound, and so I would like to create a filter that would be [Type of call] = "Inbound call" OR [Campaign] = "...". I know that with written code I just apply this filters to each one of the measures used in the page, but that would create a lot of innecessary work if there's any other way, so is there any way to have what I asked for with either slicers or page filters (or any other way that doesn't require me to modify measures individually)?

1 ACCEPTED SOLUTION

Hi @antalgu ,

 

I think that you are looking for the feature called Calcultaion Groups.

 

Here is a great article which summarizes the logic & gives you an example how to use this:

https://www.sqlbi.com/articles/introducing-calculation-groups/# 

 

edit:
Adding 2 videos which are useful too:
Guy in the Cube:  https://www.youtube.com/watch?v=vlnx7QUVYME

Marco Russo from SQLBI: https://www.youtube.com/watch?v=a4zYT-N-zsU

 

Hope it helps,

PDG

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@antalgu ,

The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in a table format?

Try these types of formulae. If they can help

 

calculate([count of call], filter(Table, not( Table[Type of call] in{"Inbound call" , "Outbound call" })))

calculate([count of call], filter(sll(Table), not( Table[Type of call] in{"Inbound call" , "Outbound call" })))

calculate([count of call], filter(sll(callType), not( callType[Type of call] in{"Inbound call" , "Outbound call" })))


Appreciate your Kudos.

Nono, the problem that I have is this one. The type of code that you presented would work to solve the problem, but it would only solve 1 of the measures, so I'd have to make this code for 10+ measures and then a pretty similar one for 10+ more measures for the other type of calls. What I'm asking is if its possible to do this kind of things with a page filter or slicer, because I don't want to have to modify the code individually for each one of my measures

Hi @antalgu ,

 

I think that you are looking for the feature called Calcultaion Groups.

 

Here is a great article which summarizes the logic & gives you an example how to use this:

https://www.sqlbi.com/articles/introducing-calculation-groups/# 

 

edit:
Adding 2 videos which are useful too:
Guy in the Cube:  https://www.youtube.com/watch?v=vlnx7QUVYME

Marco Russo from SQLBI: https://www.youtube.com/watch?v=a4zYT-N-zsU

 

Hope it helps,

PDG

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.