Latest Enterprise DNA Initiatives

Using UNICHAR Codes

HI All

I am new to Power BI and am trying to use the Up and Down coloured arrows as indicators along with some calculations. I have written the following DAX statement and I have checked each condition individually and there are no errors.

Arrows = SWITCH(
TRUE(),
[No of Audits CY] >= [No of Audits LY], UNICHAR(9650),
[No of Audits CY] <= [No of Audits LY], UNICHAR(9660),
UNICHAR(9640)
)

The two elements in the SWITCH statement are measures as well rather than fields from a table.

The issue here is that when I try to show the output “Arrow” I seem not to see what I expected (i.e. an arrow pointing up or down). I have used a Card, a Table and I have even tried formatting as a String (yeah I know) but I just cannot get the Arrow showing up. In fact, when I add the measure to a visual, it reverts to “First Arrow” - it seems to be thinking that there are more than one of these but there should just be a singular value. The two comparative measures also have singular values.

What am I missing, ignoring or doing incorrectly that the arrow symbols do not show?

PS - I even tried using other UNICODE values and the same issue occurs. Any help will be highly appreciated

Thanking you in advance

Prem

@prembij Welcome to the Enterprise DNA and thanks for posting the question on the forum. To get a solution, it is requested to please share your sample PBIX file for the experts & members to look at.

Thanks.

@prembij,

Your use of UNICHAR is spot on. I built a small sample model using the exact same SWITCH(TRUE()) UNCHAR code and it works like a champ:

image

The problem lies elsewhere within your model/measures. If you can post your PBIX file, I’m sure we can get it sorted out quickly.

I hope this is helpful. My solution file attached.

2 Likes

Hi Brian / Mudassir

Many thanks for your responses. I have attached a PBIX here (sanitised) showing the key measures used show the calc. In the visuals I have shown, as a Card, the Current Year and Last Year counts. I have then put in a table that shows the 2 measures as well as the Arrows measure which has the UNICHAR statements. As you can see the arrows do not show up. I am sure I am missing a step somewhere.

Thanking you so much for all your assistance with this

Kind regardsTest.pbix (928.5 KB)

@prembij
You have to use a measure instead of a calculated column. I just copied and pasted your code in a measure and getting the required results now.

Test.pbix (922.9 KB)

Thanks.

Hi Brian / Mudassir

I was looking at Brian’s PBIX and I spotted the problem. What I thought was a Measure was actually set-up as a column - dahhh!

Thank you both for helping with this

Kind regards

Thank you so much !!

@prembij You are welcome. The problem was when you created a calculated column, your UNICHAR code was going row by row and getting the result as 1 for every row for both years. This way both years had the same count and was showing a blank result in return.

1 Like

@MudassirAli,

image

You beat me to it by 90 seconds… :grinning:

  • Brian
1 Like

@BrianJ :stuck_out_tongue_winking_eye:

@prembij,

Very glad we were able to help. This is a good reminder though as to why it’s always best to post a PBIX file with your initial question - that would’ve allowed us to spot the problem right away, and solve this in one quick response.

  • Brian
1 Like