Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ppgandhi11
Helper V
Helper V

how to get text in new line in the data cards/label?

Hi,

 

How do i create a label that is multi lines? each line should contain a specific filter info. I am able to get all the filter info I need using DAX formulas but they all appear in the same line!

 

I tried to review this page:

 

https://community.powerbi.com/t5/Desktop/How-to-get-text-in-new-line-using-data-cards/m-p/227630/hig...

 

But I was un successful in getting this.

 

Here is my code for measure called Title:

 

Title =
var selectedicds = values(BaseQuery[icd1])
var numberofselectedicds = countrows(selectedicds)
var numberofpossibleicds = CALCULATE(DISTINCTCOUNT(BaseQuery[icd1]), all(BaseQuery[icd1]))
return
"Detailed report for: " & UNICHAR(10) & "icd:" & if (numberofselectedicds = numberofpossibleicds, "All", CONCATENATEX (VALUES(BaseQuery[icd1]), BaseQuery[icd1], ","))

 

In above code, I am expecting the label to look like:

 

Detailed report for:

icd: H10.01,H10.02

 

Current output:

 

Details report for: icd: H10.01,H10.02

 

1 ACCEPTED SOLUTION

I see, hmm....interesting. I wonder if it's some obscure system setting somewhere.

Normally I share files on this forum by posting a Dropbox or OneDrive link - would you be able to share your PBIX that way?

 

In the mean time, another method you could try is explicitly entering a newline character by pressing Alt-Enter in the formula bar.

For example:

Two Line Measure = 
VAR NewLine =
"
"
RETURN
"Hello" & NewLine & "World"

I pressed Alt-Enter between the two double-quotes in the NewLine definition.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

7 REPLIES 7
AbelNewton
Frequent Visitor

Third-party visual plug-ins is what you need. You could try Text Wrapper by MAQ Software. 

2 years later but this was helpful, thanks for this suggestion.

OwenAuger
Super User
Super User

Hi @ppgandhi11

 

I was able to get a simple measure like yours with contatenation including UNICHAR(10) displaying on multiple lines.

 

The text displayed on multiple lines in the Card visual (but not Multi-row card), Table, Matrix, or Text Wrapper custom visual.

 

What visual were you trying to include the text in, and can you post a PBIX file exhibiting the problem?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Hi @OwenAuger

 

I tried using both single row card visual and multi-row card visual. Both of them give the exact same output I had mentioned. For some reason, this user group does not allow me to send the PBIX file. So I am sending you the screen shots instead. (I had asked that question before in the group, and someone replied saying attaching files are allowed only if I have certain account type e.g. contributor etc).

 in the first screenshot, the left side is the single row card visual, right side is multi row card visual.

in the second screenshot, the forumula used is shown.

 

expected output for single row card visual is (due to unichar(10) 😞

Detailed report for:

icd: ....

Capture.PNGCapture1.PNG

 

 

I see, hmm....interesting. I wonder if it's some obscure system setting somewhere.

Normally I share files on this forum by posting a Dropbox or OneDrive link - would you be able to share your PBIX that way?

 

In the mean time, another method you could try is explicitly entering a newline character by pressing Alt-Enter in the formula bar.

For example:

Two Line Measure = 
VAR NewLine =
"
"
RETURN
"Hello" & NewLine & "World"

I pressed Alt-Enter between the two double-quotes in the NewLine definition.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

How to achieve this in power query

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

Hi @OwenAuger

 

This works. Due to security reasons, my work laptop (which has power BI installed) has onedrive and dropbox de-activated so posting PBIX there is not possible.

 

This solution works! Thanks a lot. (by creating a variable called NewLine as suggested by you).

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.