cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ppgandhi11 Member
Member

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

Accepted Solutions
OwenAuger Super Contributor
Super Contributor

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

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.



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

Proud to be a Datanaut!




5 REPLIES 5
OwenAuger Super Contributor
Super Contributor

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

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?



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

Proud to be a Datanaut!




ppgandhi11 Member
Member

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

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

 

 

OwenAuger Super Contributor
Super Contributor

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

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.



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

Proud to be a Datanaut!




ppgandhi11 Member
Member

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

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).

AbelNewton Frequent Visitor
Frequent Visitor

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

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

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 317 members 3,259 guests
Please welcome our newest community members: