Hello to all! I try to display 2 different symbols in a table depending on a status - here is the small dax function:
test status = SWITCH(TRUE();
[Projectstatus] = 0; UNICHAR(9940);
[Projectstatus] = 1; UNICHAR(9989);
"")Code works for different unichar-values - it seems to be a problem with the number range that i'm in. It ends in the result that the unichar(9989) is displayed for all rows:
Selecting only the status "0" the result is correct:
Selecting other values the result is correct:
The current work around is adding a additional character to one of the 2 unichar() expressions:
status char = SWITCH(TRUE();
AVERAGE(Testtabelle[Status]) = 1; UNICHAR(9989);
AVERAGE(Testtabelle[Status]) = 0; UNICHAR(9940)&" ";
""
)Howerver not perfect and seems to me like a bug - in case you have any questions feel free to contact me!
Best regards & thx for the fix!
Stephan
7 Comments
- v-qiuyu-msftCommunity Support
Hi sfuhr ,
I have tested in the latest Power BI desktop version and your first DAX is working. I would suggest you update your Power BI desktop to the latest version 2.66.5376.2521 as ours then test again.
Best Regards,
Qiuyun Yu - sfuhrFrequent Visitor
Hello Quiyun -
that is exactly what i'm using - so happy to know, that this works for you - might be a issue with country settings!?
Kind regards,
Stephan
- v-qiuyu-msftCommunity Support
Hi sfuhr ,
Both Power BI desktop regional settings and OS regions are English (United States). Please try to change your regional settings as ours then test again to see if the issue occurs?
Or may I know what's your Power BI desktop and OS regions?
Best Regards,
Qiuyun Yu
- JoaoMSHelper III
Hi, currently I'm having the same problems when using 3 unichar codes as you can see in the following picture:
My version of PI Desktop is from December 2019 . Any idea of solution?
Versión: 2.76.5678.782 64-bit (diciembre de 2019)
Regards,
Joao
- NolockResident Rockstar
The general recommendation is always having the current version of Power BI Desktop. Both earlier mentioned scenarios for calculated columns in DAX work in the PBI Desktop March 2020.
Btw. you don't need to use the UNICHAR function with these UNICODE codes, use UNICODE characters instead of it (https://emojipedia.org/)
- JoaoMSHelper III
Hi, it worked with the UNICODE icons!
Thanks
- gck02Advocate I
Hi,
Two years later and the bug is still present. To solve this issue I used your solution sfuhr (adding some characters after the UNICHAR function: https://community.powerbi.com/t5/Desktop/problems-using-switch-function-with-unichar/m-p/631666/highlight/true#M302027)
Thanks for your solution.
Best regards.