Forum Discussion
How to use a filter for 2 tables, filter which contains same data, but can;t join table
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
- goncalogeraldes4 years ago
Super User
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