Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nomji
Frequent Visitor

One to Many RelationShip

Hi, I am having an issue filtering or connecting two tables, I believe that I need a bridging table to connect each table, but I am unsure on how to set one up. Both datasets contain survey data, and are in "long" format i.e. each contains a unique customer ID, a column with whom they are reporting to. So the first table is like:

 

Unique Customer IDReporting Managers
1Mgr1
2Mgr2, Mgr3
3Mgr1, Mgr3, Mgr4
4Mgr2,Mgr4
5Mgr1,Mgr2,Mgr3,Mgr4

 

and then the second table is like

 

Mgr1Manager One
Mgr2Manager two
Mgr3Manager Three
Mgr4

Manager Four

Mgr5

Manager Five

 

Now, I want to have a slicer with dropdown of Managers who are mentioned in Table 1 (Mgr 1 - Mgr4) and dropdown shouldn't show Mgr5 as No one had mentioned. I am stuck with how to do relationship as Reporting Manager column is a multi select column. Dropdown should only Show Mgr 1, Mgr2, Mgr3, Mgr4 ignoring Mgr5.

 

Thanks in advance and please guide me how to get this report?

1 ACCEPTED SOLUTION

Agree with @AbhinavJoshi .

 

You can generate a new table contains the manager ID if you don't want it to affect the count.

Here're the steps:

1.Duplicate the table.

vstephenmsft_0-1726540247163.png

2.Remove other columns.

vstephenmsft_1-1726540271721.png

3.Split the column.

vstephenmsft_2-1726540288777.pngvstephenmsft_3-1726540299255.pngvstephenmsft_4-1726540303138.pngvstephenmsft_5-1726540304976.png

4.Trim to remove the spaces.

vstephenmsft_6-1726540324203.png

vstephenmsft_7-1726540332688.png

5.Go back to power bi desktop, create a measure to make the filtering successful.

Measure = IF(CONTAINSSTRING(MAX('Table'[Reporting Managers]),SELECTEDVALUE('Table (2)'[Reporting Managers])),1)

6.Put the measure into the visual-level filters and set up show items when the value is 1.

vstephenmsft_0-1726553646143.png

7.Here's the result. When you select Magr2 in the slicer, the table visual only displays the reporting managers contains Magr2.

vstephenmsft_1-1726553778230.png

Note: There's no relationship between the new table and the main table.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

4 REPLIES 4
AbhinavJoshi
Responsive Resident
Responsive Resident

HI @Nomji , I am not sure how you are linking your two tables and what data do you have at the second table other that manager rank. One option is to split the column in rows from table one using delimeter. 

AbhinavJoshi_0-1726523340157.png

 

If i split by comma and in rows how will it affect count wise? Can you elaborate more in detail please. In second table I have only Manager Id and name. In table 1 there are few other columns like hours, budget and other info

Agree with @AbhinavJoshi .

 

You can generate a new table contains the manager ID if you don't want it to affect the count.

Here're the steps:

1.Duplicate the table.

vstephenmsft_0-1726540247163.png

2.Remove other columns.

vstephenmsft_1-1726540271721.png

3.Split the column.

vstephenmsft_2-1726540288777.pngvstephenmsft_3-1726540299255.pngvstephenmsft_4-1726540303138.pngvstephenmsft_5-1726540304976.png

4.Trim to remove the spaces.

vstephenmsft_6-1726540324203.png

vstephenmsft_7-1726540332688.png

5.Go back to power bi desktop, create a measure to make the filtering successful.

Measure = IF(CONTAINSSTRING(MAX('Table'[Reporting Managers]),SELECTEDVALUE('Table (2)'[Reporting Managers])),1)

6.Put the measure into the visual-level filters and set up show items when the value is 1.

vstephenmsft_0-1726553646143.png

7.Here's the result. When you select Magr2 in the slicer, the table visual only displays the reporting managers contains Magr2.

vstephenmsft_1-1726553778230.png

Note: There's no relationship between the new table and the main table.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Thanks Stephen!!! For relationship I have included unique column and am able to receive count.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.