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
mvelazquez
Frequent Visitor

Concatenating a measure or field with a text

Hello PowerBI Gods!

 

Hope all is well and thank you in advance.

 

Here is my issue. So I have a table (see picture) that has a bunch of IDs and names. What Im trying to achieve, is that if the column defaults to just a "Policy OID broker", I want it to display something like this:  Unknown - 1234 ... Again, only for data that defaults to the "Policy OID broker"

I created a calculated column, and when I try to modify the dax to achieve what I want, I get an error.

 

Broker Name = IF(ISBLANK(TRIM(D_BROKER[BUSINESS_NAME])),IF(ISBLANK(TRIM(D_BROKER[PARTY_NAME])),"Unknown -  " & D_BROKER[POLICY_OID_BROKER],D_BROKER[PARTY_NAME]),D_BROKER[BUSINESS_NAME])
 
Can this be achieve with just a measure instead of creating a calculated column?
How can I fix my DAX to achieve that?
 
Thank You! 😄

 

 

question5.PNG

1 REPLY 1
Nathaniel_C
Super User
Super User

Hi @mvelazquez ,

Not sure if I understand exactly, but try this. When you go to a measure, unlike a calculated column, it does not have row contex. So in order to return a scalar value, it needs to be aggragated, MIN, MAX, SUM etc.  But when you apply it to a visual it is filtered by the visual, or by slicers, and they provide the filter context.

Broker Name = IF(ISBLANK(TRIM(MAX(D_BROKER[BUSINESS_NAME]))),IF(ISBLANK(TRIM(MAX((D_BROKER[PARTY_NAME]))),"Unknown -  " & MAX(D_BROKER[POLICY_OID_BROKER]),MAX(D_BROKER[PARTY_NAME])),MAX(D_BROKER[BUSINESS_NAME]))

 Let me know if this works for you, or if it does not, provide the error measure, please.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors