Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
Hi @Mary_789
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" )
)
----------------------------------
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)
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
Regards
Phil
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 66 | |
| 33 | |
| 32 | |
| 32 |