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
bmarcowka
Helper I
Helper I

Address Block

I have a need to present on a screen an address block. 

 

Needed format

 

CustName

CustAddress1

CustAddress2

CustCity, CustSt CustZip

 

Any guidance is appreciated. 

1 ACCEPTED SOLUTION
MartynRamsden
Solution Sage
Solution Sage

Hi @bmarcowka 

 

You could use the expression below to create a column in your table:

Address Block = 
VAR Name = Table1[CustName]
VAR Add1 = Table1[CustAddress1]
VAR Add2 = Table1[CustAddress2]
VAR City = Table1[CustCity]
VAR Zip = Table[CustZip]
VAR Result = 
Name & UNICHAR(10) & Add1 UNICHAR(10) & Add2 UNICHAR(10) & City & ", " & Zip
RETURN Result

 

If you need it as a measure, use this instead:

Address Block = 
VAR Name = SELECTEDVALUE( Table1[CustName] )
VAR Add1 = SELECTEDVALUE( Table1[CustAddress1] )
VAR Add2 = SELECTEDVALUE( Table1[CustAddress2] )
VAR City = SELECTEDVALUE( Table1[CustCity] )
VAR Zip = SELECTEDVALUE( Table[CustZip] )
VAR Result = 
Name & UNICHAR(10) & Add1 UNICHAR(10) & Add2 UNICHAR(10) & City & ", " & Zip
RETURN Result

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

View solution in original post

5 REPLIES 5
MartynRamsden
Solution Sage
Solution Sage

Hi @bmarcowka 

 

You could use the expression below to create a column in your table:

Address Block = 
VAR Name = Table1[CustName]
VAR Add1 = Table1[CustAddress1]
VAR Add2 = Table1[CustAddress2]
VAR City = Table1[CustCity]
VAR Zip = Table[CustZip]
VAR Result = 
Name & UNICHAR(10) & Add1 UNICHAR(10) & Add2 UNICHAR(10) & City & ", " & Zip
RETURN Result

 

If you need it as a measure, use this instead:

Address Block = 
VAR Name = SELECTEDVALUE( Table1[CustName] )
VAR Add1 = SELECTEDVALUE( Table1[CustAddress1] )
VAR Add2 = SELECTEDVALUE( Table1[CustAddress2] )
VAR City = SELECTEDVALUE( Table1[CustCity] )
VAR Zip = SELECTEDVALUE( Table[CustZip] )
VAR Result = 
Name & UNICHAR(10) & Add1 UNICHAR(10) & Add2 UNICHAR(10) & City & ", " & Zip
RETURN Result

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

Thank you @MartynRamsden. Getting message The sysntax for UNICHAR is incorrect.  

 
Address Block =
VAR CustName = OrgStops[CustName]
VAR Add1 = OrgStops[CustAddress]
VAR City = OrgStops[CustCity]
VAR State = OrgStops[CustState]VAR Zip = OrgStops[CustZip]
VAR Result =
CustName & UNICHAR(10) & Add1 UNICHAR(10) & City & ", " & Zip
RETURN Result
 
 

Hi @bmarcowka

You're missing an ampersand '&' between Add1 and UNICHAR(10)

Best regards,
Martyn

Sorry @bmarcowka

Just realised it was missing from my original example. Apologies!

Worked perfectly.  Now to get it to be left justified.  

 

Thanks again @MartynRamsden 

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.