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
gidziu
Regular Visitor

bridge, many to many issue

Going crazy with a bridge (many to many) issue. I have two tables: task (task_id, task_name) and user (user_id, user_name). Since each task can be assigned to one or many users and each user can own multiple tasks, I need bridge task_user with primary keys from each user and task tables.

 

task table:

gidziu_7-1675842565165.png

 

user table:

gidziu_1-1675841443779.png

user_task table (bridge):

gidziu_2-1675841487463.png

 

PBI relationships:

gidziu_5-1675841731683.png

 

 

First, PBI table visual based on just user table: 

gidziu_3-1675841568253.png

 

Now, added task_name to the visual from task table:

gidziu_8-1675842647995.png

 

The ask is this: I would like to display a list of users with a task name next to the user name. If no task is assigned to a user I would need empty string (user 3 record must be showing), if multiple tasks assigned to a user (e.g. user 1) just the the name of the first task should be shown. Something like this:

gidziu_9-1675842739422.png

 

Possible? Appreciate any tips.

Thank you

 

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Change the relationships to single.  In the user_task table, write this calculated column formula

Task name = related(task[task name])

From the User table, drag the 2 columns to the visual.  Drag the Task name column from the user_task table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
DvdH
Helper V
Helper V

Power BI DAX Function FIRSTNONBLANK Example - Power BI Docs
I don't know the answer but i think this function could help for the only showing 1 task per user

gidziu
Regular Visitor

Thank you for input. I tried this option. Somehow many to many does not work well with FirstNonBlank

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.