Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi All,
Still early learning this, however I am having issues with relationships
What I am trying to work out is how to show the description for multi columns ( only seem to be getting one)
table 1 - Client
table 2 - master
Client Table
Name | Gender | Description |
John Smith | 0001 | 0004 |
Claire | 0002 | Null |
Bob | 0001 | 0003 |
Master Table
ID | Description |
0001 | Male |
0002 | Female |
0003 | Australia |
0004 | New Zealand |
Power BI dash ( how i want it to show)
Client | Gender | Country of birth |
John smith | Male | New Zealand |
Claire | Female | |
Bob | Male | Australia |
Currently it will show the gender but not the country of birth ( as just shows the ID not the Desciption
I currently have a one to many relationship setup for Master table (ID) to Client table (Gender)
help please as I have about 15 fields that have IDs that all live in the Master table with a description.
Solved! Go to Solution.
hello @Tim1984
you have unique ID in Master table and you are fine with measure, then you can do this without building relationship between those two table.
1. create Gender measure with following DAX
Gender Measure =
var _ID = SELECTEDVALUE('Table 1'[Gender])
Return
MAXX(
FILTER(
'Table 2',
'Table 2'[ID]=_ID
),
'Table 2'[Description]
)
Country of Birth =
var _ID = SELECTEDVALUE('Table 1'[Description])
Return
MAXX(
FILTER(
'Table 2',
'Table 2'[ID]=_ID
),
'Table 2'[Description]
)
Hi,
One of ways to achieve this is to use USERELATIONSHIP DAX function in measures.
Please check the below picture and the attached pbix file.
USERELATIONSHIP function (DAX) - DAX | Microsoft Learn
Gender: =
IF (
HASONEVALUE ( Client[Name] ),
MAXX ( SUMMARIZE ( Client, Master[Description] ), Master[Description] )
)
Country of birth: =
CALCULATE ( [Gender:], USERELATIONSHIP ( Master[ID], Client[Description] ) )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi all,thanks for the quick reply, I'll add more.
Hi @Tim1984 ,
Use the following DAX expression to create a measure
Measure =
VAR _description = SELECTEDVALUE(Client[Description])
RETURN LOOKUPVALUE('Master'[Description],Master[ID],_description)
Turn on the 'Show item with no data' option
Best Regards,
Wenbin Zhou
Hi,
One of ways to achieve this is to use USERELATIONSHIP DAX function in measures.
Please check the below picture and the attached pbix file.
USERELATIONSHIP function (DAX) - DAX | Microsoft Learn
Gender: =
IF (
HASONEVALUE ( Client[Name] ),
MAXX ( SUMMARIZE ( Client, Master[Description] ), Master[Description] )
)
Country of birth: =
CALCULATE ( [Gender:], USERELATIONSHIP ( Master[ID], Client[Description] ) )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
hello @Tim1984
you have unique ID in Master table and you are fine with measure, then you can do this without building relationship between those two table.
1. create Gender measure with following DAX
Gender Measure =
var _ID = SELECTEDVALUE('Table 1'[Gender])
Return
MAXX(
FILTER(
'Table 2',
'Table 2'[ID]=_ID
),
'Table 2'[Description]
)
Country of Birth =
var _ID = SELECTEDVALUE('Table 1'[Description])
Return
MAXX(
FILTER(
'Table 2',
'Table 2'[ID]=_ID
),
'Table 2'[Description]
)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
87 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
60 | |
57 |