Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hey everyone, I have this simple piece of code that displays a number of star symbols according to the score for an entity (it's companies in my case).
TEST STARS =
VAR score = INT([Company Score]*5)
VAR stars = REPT(UNICHAR(11088), score)
RETURN stars
I have multiplied by 5 to make the issue totally clear: so, for a score of 3, I would expect to see INT(3*5) = 15 stars, right?
Well, power bi says "WRONG":
Now, watch this, the weird part: if I add the score in the measure's return value, i.e. changing the last line to :
RETURN score & stars
then I get the correct number of stars:
I also get the correct number of stars if I use a different star symbol, for example UNICHAR(9733).
I have spent hours debugging the wrong number of stars shown, before I realized the cause - and now, I want to get to the bottom of this.
Any ideas why this is happening? Should it be reported as a bug?
Thank you all
UPDATE1: It seems unichars up to 11034 work fine; from 11035 and onwards, the weird behaviour is happening.
UPDATE2: The cause is the existence of Calculation Groups in the model, even though not used in the offending visual.
Solved! Go to Solution.
@nchr thanks for uploading the file 🙂
(Super User status is needed to be able to attach directly to a post.)
Thanks for your additional observations, which helped investigate this. This is very odd behaviour!
At this stage I can say:
STARS fix =
VAR score =
INT( [SCORE] )
VAR stars =
REPT( UNICHAR( 11088 ) & UNICHAR( 8203 ), score )
RETURN
stars
Feel free to log this as a bug. I plan to do the same through formal/informal channels.
I'd be interested to learn if you find any other workarounds or explanations yourself.
Regards,
Update: I have posted this to the Issues forum:
Hey @nchr
I have tried to reproduce the issue at my end with similar Compay Score and TEST STARS measures, but I can't reproduce it I'm afraid.
I get the correct number of stars whether using UNICHAR 11088 or 9733.
Do you have a PBIX you could share that demonstrates the issue (sanitised if necessary)?
Regards
I am having a similar issue.
I have a simple measure:
@OwenAuger thank you for looking into this, it was driving me crazy!
As I was cleaning the model to send it here, I found out the cause, but not why it happens: it is the Calculation Group.
Although the calculation group is not used at all in the visual, it's presence in the model causes this weird behaviour. When I deleted the calc group, the star measure worked as expected.
Check it out yourself with the attached model, if you explain that weird behaviour I will find peace of mind 😉
Well, I could not find a way to attach the file here, so here is a WeTransfer link:
https://we.tl/t-lvEn7V60bI
@nchr thanks for uploading the file 🙂
(Super User status is needed to be able to attach directly to a post.)
Thanks for your additional observations, which helped investigate this. This is very odd behaviour!
At this stage I can say:
STARS fix =
VAR score =
INT( [SCORE] )
VAR stars =
REPT( UNICHAR( 11088 ) & UNICHAR( 8203 ), score )
RETURN
stars
Feel free to log this as a bug. I plan to do the same through formal/informal channels.
I'd be interested to learn if you find any other workarounds or explanations yourself.
Regards,
User | Count |
---|---|
21 | |
19 | |
12 | |
9 | |
7 |
User | Count |
---|---|
30 | |
27 | |
14 | |
13 | |
10 |