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.
Hello,
I have a Dax that I use for Dynamic title of my charts (Year and Months are dynamic based on applied filters):
Top 5 spends for 2021 (Jan, Feb, Mar, Apr...)
Can I format it so that only the months are italicized:
Top 5 spends for 2021 (Jan, Feb, Mar, Apr...)
or
have a line break so the title is two lines:
Top 5 spends for 2021
(Jan, Feb, Mar, Apr...)
Solved! Go to Solution.
After discussing this issue with @HashamNiaz, it seems like when using dynamic titles with a line break using unichar(10) in your title DAX, you need to turn the "word wrap" feature OFF under title settings for line break to work. However, with the "word wrap" feature OFF (Matrix and Table visuals), 2nd line of the title gets overlapped by the column headers.
If Word Wrap is left ON and your title runs out of the space on first line, Power BI pushes remaining test to the 2nd line which is not overlapped by the title.
Hi @zzakir !
Surprisingly, i can see the opposite while i am using matrix visual with Power BI Desktop Version: 2.92.1067.0 64-bit (April 2021)
Here is my measure DAX;
Title = "Test Year: " & SELECTEDVALUE('Calendar'[Date].[Year]) & Unichar(10) & "Test Month: " & SELECTEDVALUE('Calendar'[Date].[Month])
Agreed with you, Row Padding doesn't make any change. We have to either choose single line Title or multi-line with cutover.
Regards,
Hasham
So it works for Matrix visual but not the table? Can you change your visual to table and see if you still get the desired result? I just want to make sure that I am not missing something here. Also in your example where you have Word Wrap off in Matrix, it seems like if you left align your title it will overlap with the Matrix's column headers.
Hi @zzakir !
The effect is same for both table & matrix visual. In my visual you are oly able to see title because i have enough free space of chart area & i make title alignment to center.
Regards,
Hasham
Hi !
You can add a line break using special character UNICHAR(10), see below article for reference;
DAX – How to get a line break in a DAX measure for Labels or Titles in a Power BI report?
Regards,
Hasham
I was able to bring it down to the 2nd line using Unichar(10) but in the table visual, 2nd line of the title gets mostly overlapped by the table header (see image below). Please also note that it worked perfectly fine for bar chart... Is there something in the setting of table that I need to change?
After discussing this issue with @HashamNiaz, it seems like when using dynamic titles with a line break using unichar(10) in your title DAX, you need to turn the "word wrap" feature OFF under title settings for line break to work. However, with the "word wrap" feature OFF (Matrix and Table visuals), 2nd line of the title gets overlapped by the column headers.
If Word Wrap is left ON and your title runs out of the space on first line, Power BI pushes remaining test to the 2nd line which is not overlapped by the title.
Hi @zzakir !
There are 2 things to it, you can turn on Word Wrap for title which will eventually try to fit the title in single line.
Secondly you can increase the row padding from Grid property, this will increase the padding between all rows and also make room for title to be visible in 2 lines while title word wrap is set to off.
Regards,
Hasham
I had the Word Wrap for title on because I wanted the months to show up on 2nd line since first line doesn't have too much space because of the title prefix.
I tried increasing the padding but it only increases the padding for rows with data and not for the title row.
Hi @zzakir !
As i suggested please turn off Word wrap for title and then increase the Row adding, it will move tables rows down. Which will cause your title to show clearly.
Regards,
Hasham
I have images with both Word Wrap ON and increased padding which didn't help. The 2nd line is still getting cut off.
AND
Word Wrap OFF and increased padding... (notice I lose the line break between year and month)
It seems like there is no solution to this one. I will just need to keep Word Wrap ON, no padding and just forget about having a line break between year and months.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |