Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Mary_789
Frequent Visitor

How to use custom icons in DAX

Hello,

 

I have added in custom icons by uploading a .json file of icons I found online and wanted to use. Is there any way I can use these icons in DAX?

I currently use a switch statement to switch between icons since I have a matrix.

I tried adding in the description from the .json as the icon name, but it did not work.

 

If this is not possible, is there any other way to add additional icons and use them in DAX?

 

Thank you.

5 REPLIES 5
suparnababu8
Super User
Super User

Hi @Mary_789 

suparnababu8_0-1725777054714.png

You are expecting the above If am correct. If you want to install custome icons on DAX there is function called UNICHAR.

Here is example DAX

Vs LY Profit = 
VAR difference = [Profit] - [Profit LY]
VAR LYchange =
    DIVIDE ( difference, [Profit LY], 0 )
RETURN
    SWITCH (
        TRUE (),
        LYchange > 0,
            UNICHAR ( 9650 ) & " +"
                & FORMAT ( LYchange, "0.0 %" ) & " || " & "+ "
                & FORMAT ( difference, "0" ),
        UNICHAR ( 9660 ) & FORMAT ( LYchange, "0.0 %" ) & " || "
            & FORMAT ( difference, "0" )
    )

 

----------------------------------

suparnababu8_1-1725777195027.png

If you need mor information about UNICHAR. Pls go through below URLs.

Icons In Power BI | DAX, UNICHAR, UNICODE & Custom Images – Master Data Skills + AI (enterprisedna.c...

How to use custom Icons in DAX expressions (youtube.com)

v-chenwuz-msft
Community Support
Community Support

Hi @Mary_789 ,

 

You can try a DAX function: UNICHAR(number) to output an icon.

vchenwuzmsft_0-1664355755461.pngvchenwuzmsft_1-1664355798235.png

UniChar

 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PhilipTreacy
Super User
Super User

Hi @Mary_789 

 

Not sure how you are using a JSON file for icons?  Or what you want to use these icons for?

 

But you can use custom icons by loading them to a web accessible location and then pointing to that location/icon file - see the section about Custom Icons in this post I wrote 

 

Conditional Formatting in Power BI Tables and Matrices • My Online Training Hub

 

Your code could look something like this

27-measure-for-formatting-with-icons.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hello @PhilipTreacy ,

 

I am using json file method using the following link: https://pbivisuals.com/2021/10/29/how-to-add-custom-icons-in-power-bi-conditional-formatting/

 

I am able to upload the icons and use it under conditional formatting, but not in DAX.

 

I am using a MAXX function in DAX and return a switch true with different icons. Below is the DAX,

 

status =  

var stat = MAXX('stat_data', 'stat_data'[Status])

return

Switch(true(),

 

stat = "1", "CircleHigh",

stat = "2", "CircleMedium1",

stat = "3", "4CircleMedium2"

)

 

I want to add custom icons to stat. 

Hi Mary, I know that this post could be a bit old.

But currently I am facing the same situation and I would like if you solve it and how?

Thank you in advance 

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.