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
Anonymous
Not applicable

Filter data by 2 different filters (multiple relationships)

Hello, I have a problem in PBI, I will try to explain it.
I have this table structure:

1.png

 

I have one main table - ProductionTable. I have 2 more tables with data for cosumtion and ordered quantities. To be able to make relationships and filter by ContractNo and Product number, so I made a two dim tables with unique values. The idea is to filter by ContractNo and to get filtered data by contract from the 3 tables. I have tried a lot of relationships, but when I try to make 2 relationships between these 3 tables, PBI do not allows me.

At the moment my report works only if I put Slicer for ContractNo from the main table, not from the dim table, and the data in last column OrderedQty is not filtered by the ContractNo and shows summarized for all contracts for this specific product.

Thanks!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , refer if treatas can help

 

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

 

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

Anonymous
Not applicable

I have watched the video in the article, downloaded the example. pbix files and I think I did it properly.

Thnaks @amitchandak  for the link (https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/ and YouTube video: https://www.youtube.com/watch?v=6WU7Ze32Q3w&feature=emb_title&ab_channel=SQLBI )

I made a measure and my final formula looks like this:

 

ReaminingQTYbyPU = CALCULATE(
SUM(PurchasingTable[RemainingQTY]),
TREATAS(
SUMMARIZE( MainTable , MainTable[ContractNo]),
PurchasingTable[ContractNo])
)

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I have watched the video in the article, downloaded the example. pbix files and I think I did it properly.

Thnaks @amitchandak  for the link (https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/ and YouTube video: https://www.youtube.com/watch?v=6WU7Ze32Q3w&feature=emb_title&ab_channel=SQLBI )

I made a measure and my final formula looks like this:

 

ReaminingQTYbyPU = CALCULATE(
SUM(PurchasingTable[RemainingQTY]),
TREATAS(
SUMMARIZE( MainTable , MainTable[ContractNo]),
PurchasingTable[ContractNo])
)

 

v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

From you screenshot, I found that there will be loops in your relationship.

Please read this blog for more details: Adjusting Cross filter direction for a complex set of tables and relationships

Due to I don't know you data model, I think if you want to get the result which will be filtered by 2 different filters, you can try to build a measure by dax.

You may refer to this blog for more details about how to build a measure: Create Measure using a different filter for two columns

If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business.

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@Anonymous , refer if treatas can help

 

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

 

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

Hello @amitchandak Here is a screenshot of the relationship ana data model:

ultrashock_0-1614069811378.png

If you tell me how to delete or replace sencitive data I can attach a .pbix file, but now it is full with company data. The other mtethod is to send me your email and I can send .pbix to you.

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.