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

One slicer for two tables

Hi,

 

I have the two tables below and would like to create three slicers, Region,Year,Month;

 

But i do not have any way of creating a true relashionship between the two tables is this possible to do via dax?

 

RegionYearMonthTarget
UK2018Jan212
EU2017Feb122
USA2016March12
RegionYearMonthRev
UK2018Jan23322323
EU2017Feb32323
USA2016March232323

Thanks

 

Peter

1 ACCEPTED SOLUTION

Here's what you generally do. Just copy and paste your query for one of your tables. Remove all of the other columns other than the one that you are interested in, let's say "Year". Remove duplicates. Save as your Year table. Now, if a new year is added in the data, you will automatically get it in your Year table.

 

If you have some values in one table and some in another, then what you want to do is do as above and then repeat for your other table and then create an Append query to append them together and remove duplicate values. Now you have a dimension table that has all of the possible values in both of your tables.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

I would recommend creating a Region table, Year table and Month table. Relate these tables to both of your tables. Use the common tables as the slicers.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Sounds like a plan!

 

Would it best to ref the tables if any new values every get updated? can you even do that?

 

And if you can how? 🙂

 

Thanks

 

Peter

Here's what you generally do. Just copy and paste your query for one of your tables. Remove all of the other columns other than the one that you are interested in, let's say "Year". Remove duplicates. Save as your Year table. Now, if a new year is added in the data, you will automatically get it in your Year table.

 

If you have some values in one table and some in another, then what you want to do is do as above and then repeat for your other table and then create an Append query to append them together and remove duplicate values. Now you have a dimension table that has all of the possible values in both of your tables.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you that worked

Awesome, and we made it through the entire thread without any reference to girls or cups or anything...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.