March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hello everyone,
I’m trying to create a measure in Power BI that concatenates information from two related tables. Specifically, I want to display the phrase “Head: Professional Name (GESTOR)” where “Professional Name” comes from the d_Sócios table and “GESTOR” comes from the f_PRINCIPAL table.
The tables d_Sócios and f_PRINCIPAL are related by the columns Sigla (from d_Sócios) and GESTOR (from f_PRINCIPAL).
It's possible to do that in Power BI?
I am not able to get the measure to work correctly.
I've tried with the CONCATENATE, but without success.
Could someone help me correct this code or suggest a better approach?
Also, would it be better to do this with DAX code or by concatenating directly in a text box?
Thank you in advance for your help!
Solved! Go to Solution.
hi @amaral_diego ,
then try like:
measure =
MAXX(RELATEDTABLE(d_Sócios),d_Sócios[Professional Name])
&
MAX(f_PRINCIPAL[GESTOR])
Thanks for your assistance, but I've found another way more familiar to do.
Hi @amaral_diego
You can use the below DAX:
SELECTEDVALUE(d_Sócios[Professional Name]): This function retrieves the Professional Name from the d_Sócios table. SELECTEDVALUE is helpful here as it returns the single value in a context, or blank if there are multiple.
LOOKUPVALUE(f_PRINCIPAL[GESTOR], f_PRINCIPAL[Sigla], d_Sócios[Sigla]): This function looks up the GESTOR value in f_PRINCIPAL based on the matching Sigla in d_Sócios. It will return the value from f_PRINCIPAL if there is a unique match.
Concatenation: The & operator is used to concatenate the strings with custom text as specified.
If you need the result at a row level rather than a measure, you could also create a calculated column instead of a measure, using similar logic.
Let me know if you need further customization!
Give "Kudos" if you find it helpful! Happy Learning!! 🙂
how are they related?
Supposing d_Sócios is on the one side, try like:
measure =
MAX(d_Sócios[Professional Name])
&
MAXX(RELATEDTABLE(f_PRINCIPAL), f_PRINCIPAL[GESTOR])
I've tried with your code, without success,
they are related many to one
many from GESTOR Column from the table f_PRINCIPAL
one from Sigla Column from the table d_Sócios
I now how to do it in power apps
is something like that
Text = "Head: " & LookUp(d_Sócios, ID = ThisItem.ID, [Nome Profissional]) & " (" & LookUp(f_PRINCIPAL, ID = ThisItem.ID, [GESTOR]) & ")"
I need to know, if is possible to do something similiar on Power BI
hi @amaral_diego ,
then try like:
measure =
MAXX(RELATEDTABLE(d_Sócios),d_Sócios[Professional Name])
&
MAX(f_PRINCIPAL[GESTOR])
Thanks for your assistance, but I've found another way more familiar to do.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
17 | |
9 | |
5 |
User | Count |
---|---|
37 | |
29 | |
16 | |
14 | |
12 |