Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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:
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
Solved! Go to 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.
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.
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?
UNICHAR(10) doesnt work
Yes, newline characters (however constructed) are unfortunately ignored within data labels.
The original post concerned displaying text across multiple lines in a card visual. At that time enhanced data labels had not been released (so an arbitrary measure could not be used to specify a data label).
You could get three lines of text by making use of separate measures for Value, Title, and Detail labels (with Multi-line enabled) as described here, depending on the visual,
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: ....
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.
Adding a variable with alt+enter alos dont work
How to achieve this in power query
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).
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |