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

Simple Filter with a Many to Many Relationship

In a very simplified example, I have two tables. I have a two common fields between the two tables. Country and Fiscal Year. In one table are Sales Figures Actuals, and in the other table are Sales figures targets. The common fields between the two tables are Country and Fiscal Year,  so I have set a Many to Many relationship with the country field, as I dont believe or dont know how to create a link between two tables and two common fields (not even sure if needed, data modelling is not my strong point!)

 

How Can I display The correct Actuals with the correct Targets after filtering for Country and Fiscal year. I must be missing somethig simple in the tables and the relationships. 

 

This is an overly simplified representatin of my actual problem. Please see a link to my PBIX file with the two sample tables, and filter visualisations explaining problem and expected outcome.

 

Actuals v Targets PBIX File

 

Thanks in advance for assist. 

 

Ger

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

What you can do is make a table for years and countris (one each) then join those to your data tables and use the countries and years tables in your slicers.

ActVsBudgetModel.jpg

I have attached your file updated with the new tables and relationships and the slicers changed to use the new fields for you to look at

 

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

Hello @Anonymous 

What you can do is make a table for years and countris (one each) then join those to your data tables and use the countries and years tables in your slicers.

ActVsBudgetModel.jpg

I have attached your file updated with the new tables and relationships and the slicers changed to use the new fields for you to look at

 

Anonymous
Not applicable

Thank you @SteveCampbell  - A lot to read there, but it makes sense. I'll investigate what I can apply to my scenario.

 

@jdbuchanan71 - thank you this makes sense. I will definitely be able to apply this approach to my actual data. Thank you, I have accepted your solution.  

SteveCampbell
Memorable Member
Memorable Member

Set up a STAR schema:

https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

 

Appreciate your Kudos
Connect with me!

Stay up to date on  linkedin-logo.png
Read my blogs on  powerbi.tips_.png



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



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.