cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Two active joins? Need data modelling advice

I have built a dashboard to display survey results, however now i am trying to integrate a filter to swap between different Surveys dates (Categorical value, not an actual date). The tricky part is that I have a results table, with the field [Survey], however i also need counts of [Department] from both tables, with the ability to slice to different Surveys. 

 

SurveyResults

UserIDQuestionAnswerDepartmentSurvey
114CSMar-19
122CSMar-19
213SMMar-19
224SMMar-19
312CSSep-19
325CSSep-19
413SMSep-19
424SMSep-19
515SMSep-19
522SMSep-19

 

Participation

DepartmentTotalSurvey
CS2Mar-19
SM3Mar-19
CS2Sep-19
SM4Sep-19

 

They are joined with Many to Many, participation filters SurveyResults (active) on [Department].

 

However as the relationship is not joined on [Survey], i must use two slicers [Survey] from both tables to get the correct records filtered out, i.e Both slicers = "Sep 2019". I feel this would not be an issue if i could join on both [department] & [Survey].

 

What would be a better approach? Having to set both slicers to the correct survey isn't great.. I am quite inexperienced at data modelling so any help would be greatly appreciated.

 

One of my visuals in a table

[Department] 

[Number Completed] - Count Distinct([UserID])

[Total Employees] - Sum([Total]) 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Two active joins? Need data modelling advice

Just see the patric video(custom keys) just now he launched on guy in cube you tube channel.

So first go to second table which is partition table and click on add column and then click on index column.

So you will have one index which can be used as custom key. Then click on merge queries.
When you merge the queries it will show you table at the end of column list from there click arrow icon and just select index column.

Now you have key to join both table in many to one direction.


Another workaround for this is you need to write dax and need to merge both tables into single table and move total column to first table.


Thanks
Pravin

If it resolves your problem mark it as a solution and give Kudos.

View solution in original post

2 REPLIES 2
Highlighted
Anonymous
Not applicable

Re: Two active joins? Need data modelling advice

Just see the patric video(custom keys) just now he launched on guy in cube you tube channel.

So first go to second table which is partition table and click on add column and then click on index column.

So you will have one index which can be used as custom key. Then click on merge queries.
When you merge the queries it will show you table at the end of column list from there click arrow icon and just select index column.

Now you have key to join both table in many to one direction.


Another workaround for this is you need to write dax and need to merge both tables into single table and move total column to first table.


Thanks
Pravin

If it resolves your problem mark it as a solution and give Kudos.

View solution in original post

Highlighted
Helper I
Helper I

Re: Two active joins? Need data modelling advice

Thanks PR, I beleive your solution to this would also work so I will mark it as solved.

 

However I actually solved this just now by creating a Merged Column of both [Department] and [Survey] in both tables, and i joined on that. Which worked!! I got the idea from this website (https://radacad.com/relationship-in-power-bi-with-multiple-columns

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors