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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
EduardoCruz
Frequent Visitor

Or slicer filter with many to many relationship

Hello all,

 

I have earlier asked a question to solve a similar issue in dax, but I have found a roadblock in my dax development.

 

I was trying to emulate the following SQL union query in Power BI. I tried to use or filter logic, to get the desired results, but so happens that the second query is joining a table which has a many-to-many relationship (InterestCategory with FactActiveOpportunities).

 

SELECT
a.*
FROM [DM-Datavault].[dbo].factactiveopportunities a
LEFT JOIN [DM-Datavault].[dbo].DimCompany b on a.dimcompanysupplier = b.dimcompanycode
WHERE b.dimcompanycode = '1'
UNION
SELECT
a.*
FROM [DM-Datavault].[dbo].factactiveopportunities a
WHERE DimCategoryCode in
( SELECT
*
FROM InterestCategoryOwner
WHERE DimCompanyCode = '1')

 

 

Here's a picture of the model I'm trying to implementHere's a picture of the model I'm trying to implementHow can I tackle this issue? I'm always getting stuck on creating the measure.

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@EduardoCruz ,

 

You may take a look at links below.

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

Hi @v-chuncz-msft Sam Zha

 

Thank you for your reply.

 

I'm sorry, but I'm still feeling a bit lost. I've read and tried to apply the logic from the links you passed me, but I still didn't manage to overcome this problem. I need to add OR logic to a master slicer visual where I pass the same code onto 2 parameters.

 

The first filters the fact table on one to many values, while the second one filters based on a subquery in the where clause (due to a many to many relationship with the fact table.

 

The thing is that I want to apply this logic for the business user to filter the report as he pleases.

 

I'm having a hard time applying this filter.

 

I've tried using Calculated tables, with contains, but it's unresponsive to slicer filters the way I need it to be.

 

Is there an alternative? I'm still relatively new to dax so perhaps I may have not tested all the possible solutions.

 

Thanks,

 

Eduardo

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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