cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
soldstatic Member
Member

"Bridge" Table Filtering

Hey y'all, any help would be appreciated!

 

I have two core data tables, events and customers. There is a 'bridge' style table that links the two via foreign keys. It looks like this:

 

Premises 1-->* PremiseEvents * <--1 Events

 

The PremiseEvents table acts as a bridge table and only has three columns, PremiseID, EventID, and ID. ID is unique, PremiseID is a FK to Premises, and EventID is a FK to Events. All three tables are large, but as you can imagine the bridge table is huge (although it is narrow).

 

I'm trying to create a page where user can filter on several slicers tied to Events to get to a small number of events, say 2 or 3 or something. Once that filter is applied there would only be say 100 entries in PremiseEvents bridge table that links to the 100 customers that are impacted by that event.

 

If I drop a count(PremiseEventID) from the bridge table into the visual, it filters on both sides of the relationship and shows me what I want. But I'd prefer to not have that column on the table, and if I end up wanting to plot the some of this data that's not exactly a data point I want to plot. Putting a 'is not blank' filter on the same column on the visual does not work, I get errors saying the result set was more than 1M rows. 

 

So I'm trying to create a measure or something that I can use to filter the visual. I'm having a hell of a time. Any other ideas or recommendations for an appropriate filter would be awesome.

 

 

Attempt 1:
CustFocus = 

var __Tb = SUMMARIZE(
    'UDM TableCustomerPremises'
    ,'UDM TableCustomerPremises'[ID]
    )

var __PremFilt = 
CALCULATETABLE(
    __Tb
    ,CROSSFILTER('UDM TableEventPremise'[CustomerPremiseId],'UDM TableCustomerPremises'[ID],Both)
)

var __EventFilt = 
CALCULATETABLE(
    __PremFilt
    ,CROSSFILTER('UDM TableEventPremise'[EventListId],QualifiedEventList[ID],Both)
)

return 
    countrows(__EventFilt)

 

 

 

Attempt 2: 

CALCULATE(
    countrows(ALLSELECTED('UDM TableEventPremise') )
    ,CROSSFILTER('UDM TableCustomerPremises'[ID],'UDM TableEventPremise'[CustomerPremiseId],both)
)

 

 

 

 

1 REPLY 1
Community Support Team
Community Support Team

Re: "Bridge" Table Filtering

Hi @soldstatic ,

Can you please share a dummy file? If you can't, please share some sample data and your expected results that will make us understand clearly about your requirement.

 

How to Get Your Question Answered Quickly

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 6 members 1,657 guests
Please welcome our newest community members: