<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Certain UNICODE characters break measure results. (in a weird way, too) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076508#M106980</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="411078" data-lia-user-login="nchr" class="lia-mention lia-mention-user"&gt;nchr&lt;/a&gt;&amp;nbsp;thanks for uploading the file &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;(Super User status is needed to be able to attach directly to a post.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your additional observations, which helped investigate this. This is very odd behaviour!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this stage I can say:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;This behaviour does appear to a bug.&lt;/LI&gt;
&lt;LI&gt;I can't see any valid explanation for the behaviour, and I can't explain it in terms of the DAX engine. Hopefully someone from the Power BI team can look into this and explain.&lt;/LI&gt;
&lt;LI&gt;The behaviour occurs in Power BI visuals (or equivalent DAX queries) but not in a PivotTable connected to the Power BI dataset using Analyze in Excel. This suggests that it is a DAX-specific issue, since Excel generates MDX queries. Presumably any other client tools using MDX would not exhibit the bug.&lt;/LI&gt;
&lt;LI&gt;The conditions required to see this behaviour (from my testing) are:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;At least one calculation group is present in the model.&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;The measure being visualized returns a text value by repeating a single character multiple times.&lt;/STRONG&gt;&lt;BR /&gt;This can be done with the REPT function or CONCATENATEX/GENERATESERIES.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;More than one "row" of results is returned in the visual.&lt;/STRONG&gt;&lt;BR /&gt;If just one CompanyID is filtered for example, the STARS measure returns the correct result.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Only certain characters result in this behaviour.&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;In my testing, characters in the range 11044-11512 mostly cause the bug, with some exceptions (e.g. 11400 &amp;amp; 11480).&lt;BR /&gt;Characters outside the range 11044-11512 seem fine&lt;/EM&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Workaround:&lt;BR /&gt;The only method I can get working is to include an additional "invisible" character in the repeated string, such as UNICODE(8203). This is fine from a visual perspective, but still unsatisfying in that we have to add "redundant" characters.&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;STARS fix = 
VAR score =
    INT( [SCORE] )
VAR stars =
    REPT( UNICHAR( 11088 ) &amp;amp; UNICHAR( 8203 ), score )
RETURN
    stars&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to log this as a bug. I plan to do the same through formal/informal channels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd be interested to learn if you find any other workarounds or explanations yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Sun, 12 Feb 2023 12:42:02 GMT</pubDate>
    <dc:creator>OwenAuger</dc:creator>
    <dc:date>2023-02-12T12:42:02Z</dc:date>
    <item>
      <title>Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076174#M106951</link>
      <description>&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TEST STARS = 
VAR score = INT([Company Score]*5)
VAR stars = REPT(UNICHAR(11088), score)
RETURN stars &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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, &lt;U&gt;&lt;STRONG&gt;right?&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, power bi says "&lt;STRONG&gt;&lt;U&gt;WRONG&lt;/U&gt;&lt;/STRONG&gt;":&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, watch this, the &lt;EM&gt;weird&lt;/EM&gt; part: if I add the score in the measure's return value, i.e. changing the last line to :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RETURN score &amp;amp; stars&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I get the correct number of stars:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also get the correct number of stars if I use a different star symbol, for example&amp;nbsp;&lt;SPAN&gt;UNICHAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;9733&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas why this is happening? Should it be reported as a bug?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you all&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE1: It seems unichars up to&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;11034&lt;/STRONG&gt; work fine; from &lt;STRONG&gt;11035&lt;/STRONG&gt; and onwards, the weird behaviour is happening.&lt;BR /&gt;UPDATE2: The cause is the existence of Calculation Groups in the model, even though not used in the offending visual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 08:09:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076174#M106951</guid>
      <dc:creator>nchr</dc:creator>
      <dc:date>2023-02-12T08:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076258#M106959</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="411078" data-lia-user-login="nchr" class="lia-mention lia-mention-user"&gt;nchr&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I get the correct number of stars whether using UNICHAR 11088 or 9733.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a PBIX you could share that demonstrates the issue (sanitised if necessary)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 21:46:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076258#M106959</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-02-11T21:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076418#M106977</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&amp;nbsp;thank you for looking into this, it was driving me crazy!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check it out yourself with the attached model, if you explain that weird behaviour I will find peace of mind &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I could not find a way to attach the file here, so here is a WeTransfer link:&lt;BR /&gt;&lt;A title="SAMPLE PBIX FILE" href="https://we.tl/t-lvEn7V60bI" target="_self"&gt;https://we.tl/t-lvEn7V60bI&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 08:10:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076418#M106977</guid>
      <dc:creator>nchr</dc:creator>
      <dc:date>2023-02-12T08:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076508#M106980</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="411078" data-lia-user-login="nchr" class="lia-mention lia-mention-user"&gt;nchr&lt;/a&gt;&amp;nbsp;thanks for uploading the file &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;(Super User status is needed to be able to attach directly to a post.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your additional observations, which helped investigate this. This is very odd behaviour!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this stage I can say:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;This behaviour does appear to a bug.&lt;/LI&gt;
&lt;LI&gt;I can't see any valid explanation for the behaviour, and I can't explain it in terms of the DAX engine. Hopefully someone from the Power BI team can look into this and explain.&lt;/LI&gt;
&lt;LI&gt;The behaviour occurs in Power BI visuals (or equivalent DAX queries) but not in a PivotTable connected to the Power BI dataset using Analyze in Excel. This suggests that it is a DAX-specific issue, since Excel generates MDX queries. Presumably any other client tools using MDX would not exhibit the bug.&lt;/LI&gt;
&lt;LI&gt;The conditions required to see this behaviour (from my testing) are:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;At least one calculation group is present in the model.&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;The measure being visualized returns a text value by repeating a single character multiple times.&lt;/STRONG&gt;&lt;BR /&gt;This can be done with the REPT function or CONCATENATEX/GENERATESERIES.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;More than one "row" of results is returned in the visual.&lt;/STRONG&gt;&lt;BR /&gt;If just one CompanyID is filtered for example, the STARS measure returns the correct result.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Only certain characters result in this behaviour.&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;In my testing, characters in the range 11044-11512 mostly cause the bug, with some exceptions (e.g. 11400 &amp;amp; 11480).&lt;BR /&gt;Characters outside the range 11044-11512 seem fine&lt;/EM&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Workaround:&lt;BR /&gt;The only method I can get working is to include an additional "invisible" character in the repeated string, such as UNICODE(8203). This is fine from a visual perspective, but still unsatisfying in that we have to add "redundant" characters.&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;STARS fix = 
VAR score =
    INT( [SCORE] )
VAR stars =
    REPT( UNICHAR( 11088 ) &amp;amp; UNICHAR( 8203 ), score )
RETURN
    stars&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to log this as a bug. I plan to do the same through formal/informal channels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd be interested to learn if you find any other workarounds or explanations yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 12:42:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3076508#M106980</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-02-12T12:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3078492#M107138</link>
      <description>&lt;P&gt;Update: I have posted this to the Issues forum:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Issues/Text-measure-returns-incorrect-value-under-certain-conditions/idi-p/3076939" target="_blank"&gt;https://community.powerbi.com/t5/Issues/Text-measure-returns-incorrect-value-under-certain-conditions/idi-p/3076939&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 22:54:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3078492#M107138</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-02-13T22:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Certain UNICODE characters break measure results. (in a weird way, too)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3473163#M132634</link>
      <description>&lt;P&gt;I am having a similar issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt; &lt;SPAN&gt;maxcol&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;S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t;&lt;DIV&gt;&lt;SPAN&gt;If I change True to say "Fish" it still works and returns fish where true, but if I change it to other words eg 'Dog' it doesn't caluclate correctly and gives a false were a true or 'dog' should be.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How does simply changing the string impact the measure in this way?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Oct 2023 10:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Certain-UNICODE-characters-break-measure-results-in-a-weird-way/m-p/3473163#M132634</guid>
      <dc:creator>Mi_80</dc:creator>
      <dc:date>2023-10-12T10:13:54Z</dc:date>
    </item>
  </channel>
</rss>

