Utilizing Unicode Characters in Energy BI

Date:


Unicode Characters in Power BI

There are a number of eventualities to make use of Unicode characters in Energy BI together with however not restricted to:

  • Creating easy KPI columns in Desk or Matrix visuals
  • To point out the standing of a measure extra visually like utilizing begins
  • Utilizing Unicode characters as icons in your reviews representing the topic

Chris Webb defined a number of the above eventualities right here.

On this put up I clarify how you should use Energy BI as a software to generate virtually all legitimate Unicode characters in Energy BI. You’ll be able to obtain the PBIT on the backside of this put up. Then you’ll be able to copy the Unicode characters from Energy BI and use them in all textual elements of your report like visible titles, textual content bins and so forth.

The Unicode planes begin from 0 to 1,114,111 which is decimal equal of 0 to 10FFFF in hexadecimal numeral system. For extra data on Unicode planes test this out.

So, a easy strategy to generate all attainable Unicode characters is to generate a listing of decimal numbers ranging from 0 ending at 1,114,111. This manner we generate a sequence of decimal numbers whatever the gaps between beginning and ending Unicode blocks. Then utilizing UNICHAR() operate in DAX to generate corresponding Unicode characters. With the next DAX expression you’ll be able to simply generate a listing and the corresponding Unicode characters:

Generate Unicode = 
SELECTCOLUMNS(
  ADDCOLUMNS(
      GENERATESERIES(0, 1114111, 1)
    , "Unicode Character"
    , IFERROR(UNICHAR([Value]), "Not Supported")
     )
, "Decimal Worth", [Value]
, "Unicode Character", [Unicode Character]
)

Generate Unicode Characters in DAX

Whereas producing Unicode characters with the above situation is technically working, however, it’s not ok. With than 1 million rows, together with all decimal numbers even these ones that aren’t legitimate, discovering a Unicode character seems to be very arduous.

So I considered a greater means of getting information from internet that comes with Unicode Planes, Unicode Blocks and block vary. Probably the greatest on-line sources I discovered is Wikipedia.

Wikipedia, Unicode Blocks

So we simply must:

  • import information from the desk within the above Wikipedia hyperlink
  • cut up the “Block Vary” column to 2 columns containing Block Vary Begin and Block Vary Finish
  • generate values between Block Vary Begin and Block Vary Finish
Unicode Blocks Table from Wikipedia
Imported Unicode Blocks Knowledge from Wikipedia

The one half which isn’t that straight ahead is changing hexadecimal values to decimal values. Bear in mind, UNICHAR() operate solely accepts decimal enter values.

I began constructing a Energy Question operate to transform hexadecimal to decimal, however, it was buggy and never environment friendly in any respect. So I googled hex to decimal and discovered this text written by “Greg Deckler” that works very effectively, significantly better than what I used to be constructing.

Hexadecimal to decimal in Power Query
Transformed Hex Values to Decimal Values

UPDATE: A giant shout out to Rocco Lupoi who shared his Energy Question code within the feedback. His code is NOT recursive, so it performs higher on bigger quantities of knowledge. Give Rocco’s code a go and see the way it works in your situation.

Now that I’ve the beginning and finish Unicode Block Ranges in decimal, I can simply generate a listing of values between the beginning and finish ranges in Energy Question utilizing “Listing.Generate”.

List of Decimal Values
A New Column of Decimal Values Has Been Added

Increasing the “Unicode Decimal” record column provides us all decimal values in vary that may be handed to UNICHAR() operate in DAX.

Expanded List Column
Expanded Listing Column

After loading the info we simply want so as to add a calculated column with the next expression:

Unicode Character = IFERROR(UNICHAR('Unicode'[Unicode Decimal]), "Not Supported")
Unicode Characters in DAX
Unicode Characters in DAX

Now you’ll be able to simply discover and replica a Unicode Character and use it in your report pages, visuals and so forth with out consuming a whole lot of storage. As you could already know, after September 2018 launch of Energy BI Desktop we are able to simply copy values from Desk and Matrix visuals which makes it straightforward to repeat Unicode Values.

The PBIT file is obtainable to obtain, all you’ll want to do is to open the file, right-click on any desired Unicode Character from the Unicodes Desk then click on “Copy worth”.

Copy Value from Table in Power BI Desktop
Copying Unicode Character from Desk

Now you can paste the character in all textual elements of a report in Energy BI together with within the visible titles and Textual content bins. You’ll be able to even use the Unicode characters to rename a measure or column within the “Fields” tab from “Visualization” ache.

Unicode Characters in Measure Names
Unicode Characters in Renaming Measures in Visuals

Obtain the PBIT file from right here.

Extra to learn: Unicode Consortium official web site.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Share post:

Subscribe

spot_imgspot_img

Popular

More like this
Related

7 Bizarre Details About Black Holes

Black holes are maybe probably the most...

Deal with and Optimize Massive Product Catalogs in Magento

Dealing with and optimizing giant product catalogs in...

Assembly Minutes Matter — My Suggestions and Methods for Be aware-Taking

I've taken my justifiable share of notes as...