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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
cristianj
Helper IV
Helper IV

How to use a filter for 2 tables, filter which contains same data, but can;t join table

Hello 

I have 2 tables one which contains sales and one with Warranties, i cant use a relation between those 2 table, they are allready joined by the data field, the problem is that both of them contains a field name Country, with data is identical, is there a way to use a single slicer, to filter both of them at the same time? so i don't use 2 country slicers?

Thank you

6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @cristianj,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
goncalogeraldes
Super User
Super User

Hello there @cristianj ! What you need is a dimension table to connect both of the different "sides" of the company you want to analyze. In attachment you'll find some links that will guide in understanding what are Fact and Dimension Tables and how to apply them to Power BI in order to obtain the needed star schema. Summing up, what you need is a Country Dimension table that contains the CountryID (hopefully) and the Country Name that allows to connect to the Sales and Warranties table via a one-to-many relationship with each.

 

Fact vs. Dimension Tables in Power BI - Kumo Partners

Why and how to Keep Dimensions & Facts tables separate - DAX modeling (theexcelclub.com)

Understand star schema and the importance for Power BI - Power BI | Microsoft DocsPower BI Basics of Modeling: Star Schema and How to Build it - RADACAD

 

Alternatively, you can use the TREATAS() function to propagate filters to unrelated tables.

 

TREATAS function - DAX | Microsoft Docs

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Hello, this is my data model,

in fact i don;t need to filter all info, just to calculate, sum(ordersSM[TelefVandute]), if i select a timeframe in date - something like a month, i want to know, number of Warranty, interval, and the  sum(ordersSM[TelefVandute]) for that period, and maybe filtered by contry and model . it would be better if i use a measure i think

Thank you

cristianj_0-1657101815700.png

 

Helo there @cristianj ! Beware of extensive use of calculated columns. Due to the difference between Measures and Calculated Columns, you should always consider carefully which one to choose. There isn't a clear choice between which each one so you should consider the context of your model. However, my recommendation would be to avoid Calculated Columns in Fact tables as much as possible, specially in "heavy models" since they are going to be a burden on the refresh. Please use the following link for further documentation:

 

Calculated Columns and Measures in DAX - SQLBI

 

Regarding your question on filters, it is always better to model your data according to Power BI's best practices. Therefore, having a Country Dimension and a Model Dimension would be the best direction to go for now.

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

 

NickolajJessen
Solution Sage
Solution Sage

Hi,

When asking a question about datamodelling and relationships, it's a good idea to include a picture of your datamodel and description of relationships.
Check out this thread for further explainiation:
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523#M6071...

That being said, you might look into incorporation Dimension tables into your datamodel. I'm sure you preferred PowerBi youtuber will have a video on this.

AliceW
Impactful Individual
Impactful Individual

If the connection between the table is one-to-many, use the Country field in the table in the 'one' section.

It should filter both.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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