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
carlenb
Advocate II
Advocate II

Create one slicer / measure from dates in two tables?

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 🙂 

 

carlenb_1-1695209912919.png

 

 

2 ACCEPTED SOLUTIONS
JoeBarry
Solution Sage
Solution Sage

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

View solution in original post

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. 

View solution in original post

5 REPLIES 5
JoeBarry
Solution Sage
Solution Sage

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. 

carlenb
Advocate II
Advocate II

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? 

ERD
Community Champion
Community Champion

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!

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.