Unichar Table in Power BI: How to Add Special Symbols
In this article
To create a Unichar table in Power BI, you must use the UNICHAR() DAX function to convert decimal code points into visual symbols, which can then be used in measures, calculated columns, or table visuals to create custom indicators, stars, and arrows. This process allows you to bypass the limitations of standard keyboard inputs and integrate professional iconography directly into your data visualizations without importing external image files.
What You'll Need
- Power BI Desktop installed on your machine.
- A dataset already loaded into your model (to apply the symbols to specific data points).
- A reference list of Unicode decimal values (available via the official Unicode consortium or online character maps).
- Basic knowledge of DAX (Data Analysis Expressions) for creating calculated columns or measures.
Step-by-Step
- Identify the Required Symbols: Determine which symbols you need for your report. For example, if you want a green checkmark for "Complete" and a red cross for "Pending," you need the decimal codes for those specific characters. Common codes include 9745 for a checkmark box and 9888 for a warning sign.
- Create a Reference Table (Optional but Recommended): If you plan to use many different symbols, do not hard-code them into every measure. Go to the Home tab, select Enter Data, and create a small table named "SymbolReference". Add two columns: "SymbolName" (e.g., Checkmark, Warning, ArrowUp) and "UnicodeValue" (e.g., 9745, 9888, 8593). This makes your DAX formulas easier to read and maintain.
- Build a Conditional Measure: To make the symbols dynamic based on your data, you need a measure. Right-click your data table and select New Measure. Use a SWITCH statement to assign a UNICHAR value to a specific condition. For example:
Status Icon = SWITCH(TRUE(), [Sales] >= [Target], UNICHAR(9745), [Sales] < [Target], UNICHAR(9888), UNICHAR(10008)). Note that labels and menu paths may differ slightly depending on your Power BI Desktop version or region. - Apply the Measure to a Visual: Drag your new "Status Icon" measure into a Table or Matrix visual. The decimal code will now render as the actual symbol. If you see a number instead of a symbol, ensure the measure is returning a text string.
- Configure Conditional Formatting: Symbols alone are often not enough; color is key. Select the visual, go to the Format pane, and find the Conditional Formatting section. Choose "Font color" and set the rules based on the same logic used in your measure (e.g., if Sales >= Target, then Green).
- Refine the Visual Alignment: Because UNICHAR symbols vary in width, adjust the column width in your table visual to ensure the icons are centered and do not wrap to a second line, which would break the visual flow of the report.
Common Mistakes
One of the most frequent errors is using the hexadecimal code instead of the decimal code. Unicode charts often list characters in hex (e.g., U+2713), but the UNICHAR function in Power BI requires the decimal equivalent (e.g., 10003). If you enter a hex code, the function will either return the wrong character or an error. Another common mistake is forgetting that not all fonts support every Unicode character. If you see a square box (often called a "tofu" character), it means the current font cannot render that specific symbol. You must change the font in the Format pane to a more comprehensive font like Segoe UI Symbol or Arial Unicode MS.
Users also frequently try to use UNICHAR in the Power Query (M) editor. UNICHAR is a DAX function, meaning it only works in the front-end data model, not during the data loading phase. If you need symbols during the transformation stage, you must use the M function Character.FromNumber(), which is the equivalent of DAX's UNICHAR.
Tips
To create a truly professional dashboard, combine UNICHAR symbols with a "KPI Indicator" approach. Instead of just showing a symbol, create a measure that combines the symbol and the value, such as "" & UNICHAR(8593) & " " & [GrowthPercentage]. This puts the arrow and the percentage in a single cell, saving space and improving readability.
For those who struggle to find the correct decimal codes, a quick trick is to use the Windows Character Map (charmap.exe). Select the character you want, and the decimal code is usually listed in the bottom right corner of the window. Additionally, using a dedicated "Symbol Table" as mentioned in the steps allows you to change the symbol across the entire report by updating a single row in the reference table rather than editing twenty different DAX measures.
When using symbols in a Matrix visual, place the UNICHAR measure in the "Values" area but keep the "Subtotals" turned off for that specific column. Subtotals of symbols often result in a confusing string of characters or a blank space that disrupts the visual alignment of your rows.
Troubleshooting
If the symbol is not appearing and you see a number instead, check your DAX formula syntax. Ensure the UNICHAR function is not wrapped in a mathematical operation that forces the result into a numeric data type. The output of UNICHAR is always text. If the visual shows a blank, verify that the decimal code you are using is within the valid Unicode range (0 to 1,114,111). If you use a code outside this range, Power BI will return an empty result.
If the symbol appears as a box or a question mark, this is a font rendering issue. Go to the Format pane > Visual > Values > Font and try switching to "Segoe UI Symbol". This font is designed specifically to handle a wide array of Unicode characters and is installed by default on most Windows systems. If you are publishing the report to the Power BI Service (web), the font support is generally consistent, but if the end-user is on a very old browser or non-Windows OS, some specialized symbols may not render correctly.
If your measure is returning an error saying "The expression refers to a column that does not exist," check that you are using a measure and not a calculated column if the logic depends on user-selected filters (Slicers). UNICHAR measures react to slicers in real-time, whereas calculated columns are computed only during the data refresh.
Frequently Asked Questions
Can I use UNICHAR in Power Query?
No, UNICHAR is a DAX function. To achieve the same result in Power Query, use the Character.FromNumber() function in a custom column.
Which font is best for Unicode symbols in Power BI?
Segoe UI Symbol is generally the most reliable font for rendering a wide variety of icons and symbols across different Power BI visuals.
How do I find the decimal code for a symbol?
You can use the Windows Character Map tool or a Unicode search website. Ensure you convert any Hexadecimal (Hex) values to Decimal before using them in DAX.
Can I change the color of a UNICHAR symbol?
Yes, use the Conditional Formatting options in the Format pane under "Font color" to assign colors based on a field or a specific rule.
Will UNICHAR symbols work on the Power BI mobile app?
Yes, as long as the mobile device's operating system supports the Unicode characters and the font used in the report.
Is there a limit to how many symbols I can use?
There is no hard limit on the number of symbols, but using too many different icons in a single visual can clutter the report and make it harder for users to interpret the data quickly.