Forum Discussion
How to Bold Specific Column Values in Power BI Table Visual.
- 1 year ago
Your Target column have numbers and texts, thats why its say's cannot convert text to int.
Now i update the measure to include texts, please try it:BoldTarget = VAR RawText = SELECTEDVALUE(financials[Country]) RETURN IF ( ISBLANK(RawText), BLANK(), VAR LengthOfText = LEN(RawText) VAR Chars = ADDCOLUMNS ( GENERATESERIES(1, LengthOfText, 1), "@Char", MID(RawText, [Value], 1), "@Code", UNICODE(MID(RawText, [Value], 1)), "@BoldChar", SWITCH ( TRUE(), // Digits 0–9 → 𝟬–𝟵 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("0") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("9"), UNICHAR(UNICODE("𝟬") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("0")), // Uppercase A–Z → 𝗔–𝗭 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("A") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("Z"), UNICHAR(UNICODE("𝗔") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("A")), // Lowercase a–z → 𝗮–𝘇 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("a") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("z"), UNICHAR(UNICODE("𝗮") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("a")), // Percent sign MID(RawText, [Value], 1) = "%", "%", // Dot MID(RawText, [Value], 1) = ".", "·", // Hyphen MID(RawText, [Value], 1) = "-", "-", // Default: keep original MID(RawText, [Value], 1) ) ) RETURN CONCATENATEX ( Chars, [@BoldChar], "", [Value], ASC ) )Just assign your value to RawText variable, but make sure that is correctly formatted.
Thank you
Hi Gopiraju404 ,
Power BI doesn’t currently support direct font style formatting (like bold) on individual columns in a table visual through the standard Format pane.
One approach, we can use, is to create a DAX measure to map this, assuming that you have a mesure named Target, please use this DAX:
BoldTarget =
VAR RawText =
// Format the Target value as “0.00%” (two decimal places plus a percent sign)
FORMAT ( [Target], "0.00%" )
VAR LengthOfText =
LEN ( RawText )
// Create a virtual table of positions from 1 to the length of RawText
VAR Positions =
GENERATESERIES ( 1, LengthOfText, 1 )
// For each position, extract the single character, then map it to its “bold” Unicode equivalent
VAR MappedCharacters =
ADDCOLUMNS (
Positions,
"@OriginalChar", MID ( RawText, [Value], 1 ),
"@BoldChar",
SWITCH (
TRUE (),
// If it’s a digit “0”–“9”, calculate its bold‐digit codepoint:
UNICODE ( MID ( RawText, [Value], 1 ) ) >= UNICODE ( "0" )
&& UNICODE ( MID ( RawText, [Value], 1 ) ) <= UNICODE ( "9" ),
// Bold zero ’𝟎’ starts at U+1D7CE; so:
UNICHAR (
UNICODE ( MID ( RawText, [Value], 1 ) )
- UNICODE ( "0" )
+ UNICODE ( "𝟎" )
),
// If it’s a decimal point “.”, replace with a middle dot “·” (visually similar to bold “.”)
MID ( RawText, [Value], 1 ) = ".",
"·",
// If it’s a percent sign “%”, use the fullwidth/bold‐style percent “%” (U+FF05)
MID ( RawText, [Value], 1 ) = "%",
"%",
// Otherwise, leave the character as is (e.g., minus sign, space, etc.)
MID ( RawText, [Value], 1 )
)
)
// Concatenate all the mapped characters back in the original order
RETURN
CONCATENATEX (
MappedCharacters,
[@BoldChar],
"", // no delimiter
[Value], // sort by position ascending
ASC
)
Now instead of using your original target measure in the table, please use this one.
Your finally output will look like this:
I got error .
This is my exact sample data.
please help
Thank you.
- Bibiano_Geraldo1 year agoSuper User
Your Target column have numbers and texts, thats why its say's cannot convert text to int.
Now i update the measure to include texts, please try it:BoldTarget = VAR RawText = SELECTEDVALUE(financials[Country]) RETURN IF ( ISBLANK(RawText), BLANK(), VAR LengthOfText = LEN(RawText) VAR Chars = ADDCOLUMNS ( GENERATESERIES(1, LengthOfText, 1), "@Char", MID(RawText, [Value], 1), "@Code", UNICODE(MID(RawText, [Value], 1)), "@BoldChar", SWITCH ( TRUE(), // Digits 0–9 → 𝟬–𝟵 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("0") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("9"), UNICHAR(UNICODE("𝟬") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("0")), // Uppercase A–Z → 𝗔–𝗭 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("A") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("Z"), UNICHAR(UNICODE("𝗔") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("A")), // Lowercase a–z → 𝗮–𝘇 UNICODE(MID(RawText, [Value], 1)) >= UNICODE("a") && UNICODE(MID(RawText, [Value], 1)) <= UNICODE("z"), UNICHAR(UNICODE("𝗮") + UNICODE(MID(RawText, [Value], 1)) - UNICODE("a")), // Percent sign MID(RawText, [Value], 1) = "%", "%", // Dot MID(RawText, [Value], 1) = ".", "·", // Hyphen MID(RawText, [Value], 1) = "-", "-", // Default: keep original MID(RawText, [Value], 1) ) ) RETURN CONCATENATEX ( Chars, [@BoldChar], "", [Value], ASC ) )Just assign your value to RawText variable, but make sure that is correctly formatted.
Thank you