Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have two tables. I want to create ONE slicer to filter out the year for both "Year" and "Date order". The difference in the data is that table 1 is 2023 data and table 2 data is past data. See below.
Edit: The data is table 1 and table 2 is not the same. There will be columns and data not existing in the other table.
How can I create a slicer/measure for this in DAX? I tried to create a relationship in model view but that doesn't work.
Thanks for any help on this 🙂
Solved! Go to Solution.
Hi @carlenb
You should always have a date table in your data model. https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables
Any table that has a relationship with the date table can be compared to each other at a date level.
When you create your date table, create a one to many relationship between the date column in the date table and the date column in your two existing tables. There shouldn't be any relationship between the exsiting two tables.
Any visuals or slicers you have that require a date, then please use the columns from the date table instead of the existing tables.
Thanks
Joe
If this post helps, then please Accept it as the solution
You will need to create a supplier dimension table. This will have all of your suppliers and you create the same realationship as the date table.
You should read this article https://learn.microsoft.com/en-us/power-bi/guidance/star-schema It will help you develop a good data model, which will allow you to make comparisons acroos multiple tables.
Hi @carlenb
You should always have a date table in your data model. https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables
Any table that has a relationship with the date table can be compared to each other at a date level.
When you create your date table, create a one to many relationship between the date column in the date table and the date column in your two existing tables. There shouldn't be any relationship between the exsiting two tables.
Any visuals or slicers you have that require a date, then please use the columns from the date table instead of the existing tables.
Thanks
Joe
If this post helps, then please Accept it as the solution
@JoeBarry thank you, I think I managed to get it to work 🙂
Now with my dates up and running, let's say I want to connect the suppliers in my two tables so that I can calculate quantity, volumes etc. Some suppliers will exist in both, some will exist in only one. What would be the best practice? Do I simply create a many to many relationship between "Suppliers" in both tables?
You will need to create a supplier dimension table. This will have all of your suppliers and you create the same realationship as the date table.
You should read this article https://learn.microsoft.com/en-us/power-bi/guidance/star-schema It will help you develop a good data model, which will allow you to make comparisons acroos multiple tables.
Thanks @ERD . Good point, but the data is not the same. There will be data and columns not existing in one and another.
Any ideas?
If the tables are the same, but with different periods, I would union them to one table in Power Query first.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |