Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
farina_dj
Regular Visitor

Advanced filter options from different source.

Hi Community, good day,

I'm a bit stuck in a solution I need to produce for an odd situation.

I'd like to ask your help to see if it's possible what I'm trying to do, please.

 

My main table is a list of Events, similar to this:

Event Customer Severity
x1c1Info
x2c1Warning
x3c2Critical
x4c3Info


Now I need to add the information Areas where the event happened because the user wants to filter by them. It's in a new table, registered like this:

 

IDEventArea
1x1Zone 1
2x1Zone 2
3x2Zone 1
4x3Zone 1

 

As you can see the relationship between Events and Areas will be 1 - N. So if I just do a direct join (or merge) it will bring duplicate records for events. That is exactly what I need to prevent, but I also need to add the filter by Areas in the dashboard.

farina_dj_3-1658514753549.png

I did try to concatenate them first to have a 1-1 relationship but the filter becomes like:

farina_dj_6-1658515117680.png

 

Which is not good, because these values can vary among many types of areas and happen simultaneously in many. We could have for example |Zone B, Floor 2|, |Zone B, Floor 4, Zone 1|, etc.

Although we have the Advance Filter, using the option "contain" and then filtering by a term, the users don't necessarily know all the names of the areas that it can be to insert the correct term.

 

So the question is. Is there programmability that makes a filter give the options from a different source table (for example with all the areas) and applies it against the main table with a "contains" clause? Or if there is another solution that I'm not seeing, please.

 

I really appreciate the attention, thanks.

 

8 REPLIES 8
Greg_Deckler
Super User
Super User

@farina_dj Can you just have 2 slicers, one for Event and one for Area?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , thanks for the answer. 
I might be missing something. A slicer needs a field to filter right? But as the relation is 1 - N, it's duplicating the events. If I go for making the relationship 1-1 by concatenating the areas in a event, I have that ugly filter like:

farina_dj_0-1658518464385.png

 

@farina_dj I'm not understanding something. If the relationship is Events 1:N Areas and you create a slicer based on the Event column in Events and create a slicer based on the Area column of Areas then when you select an Event in that slicer then the Area slicer will only display areas for that Event. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , sorry, no I didn't create a slicer for Event. Events is the table I'm analysing. I want to see events for the Customer X, events of the country Y, events with critical severity, events in the area Zone 1, etc. Events is the main table, EventID would be de PrimaryKey.

@farina_dj Is your relationship bi-directional?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, No It's one EventID that can have many Areas related so a 1-N in the relationship between Event-Area.

Events has many others relationships with other tables, but just 1-1, only in this case of Area that the same EventID can happen in more than one Area.

Area has just this relation with Events.

@farina_dj Can you make it bi-directional or no? That would solve the issue so that Areas can filter Events



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler , sorry I think I didn't understand before, The table Areas does filter the Events, yes.
If I do a regular relation between Events and Areas I does work, and the filter get like this: 

farina_dj_1-1658523238836.png

And it filters by Areas. If I select Zone 2 it shows me only events of the Zone 2.

But the problem is the events that happens in Zone 1 and Zone 2 are being counted twice. Which means that if I don't apply any filter, the number of events is wrong, because the relation with Areas brings a cartesian plane.
That's the why I tried to produce another table AreasConcatenated that groups the same EventID and concatenates the areas to have a 1-1 relation. So the row becomes EventID = "x1", Area = "Zone 1, Zone 2".
But then it brakes the filter, because it becomes: 

farina_dj_2-1658523590821.png

What I'm trying to reach is a filter that only shows one option for each Area, but in a way that doesn't duplicate the event records if I don't filter.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors