Welcome to Excel Jet Consult blog post. In this tutorial, we will learn how to use the UNICHAR Dax function to add check-marks to our data in Power BI. Let’s get started
UNICHAR Function returns the Unicode character that is referenced by the given numeric value.
UNICHAR Syntax =UNICHAR(number)
REPT Function repeat text over a given number of times
REPT Syntax =REPT(Text, NumberOfTimes)
In the Report view of the caption below, we want to apply love characters to the rating. For example, Abiola David has Rating of 3. Therefore, we will have 3 red-arrow love character and 2 green love character
- In the Calculations group of the Modelling tab, click on New Measure
- In the formula bar, execute the formula: Love Rating = REPT(UNICHAR(11088),SUM(Data[Rating]))&REPT(UNICHAR(10024),5-SUM(Data[Rating]))
In the above DAX formula, the Unicode number for red-arrow love and green love characters are 11088 and 10024 respectively. Furthermore, I used ampersand sign (&) to join the two formula string together – REPT(UNICHAR(11088),SUM(Data[Rating])) and REPT(UNICHAR(10024),5-SUM(Data[Rating]))
The SUM function enables us to reference the column and Table name
The minus 5 indicates that we have 5 Love Rating
- Drag and drop the Love Rating measure into the Values axis
In the caption above, we can see that Samantha Trume had 5 rating hence, we have five red arrow apple all through.
Note, there are hundreds of Unicode characters to use depending on specific needs