<?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: Number Formatting Function in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187840#M5987</link>
    <description>&lt;P&gt;thanks a lot&amp;nbsp;&lt;A title="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/23932" target="_blank"&gt;@rgodfrey&lt;/A&gt;. that helped.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2017 08:12:57 GMT</pubDate>
    <dc:creator>abhay03</dc:creator>
    <dc:date>2017-06-05T08:12:57Z</dc:date>
    <item>
      <title>Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/143335#M4934</link>
      <description>&lt;P&gt;In my custom visual, I'm trying to get the format from a measure. This passes the format of the measure to the ts file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dataViews[0].categorical.values[0].source.format&lt;/PRE&gt;&lt;P&gt;It produces a value like: '0.0 %;-0.0 %;0.0 %' for a percent with 1 decimal and '\$#,0;(\$#,0);\$#,0' for a dollar amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do I apply that to a number? There has to be a standard function, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 21:22:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/143335#M4934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-15T21:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/144288#M4954</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on my research, you may use&amp;nbsp;&lt;A href="https://github.com/Microsoft/powerbi-visuals-utils-formattingutils/blob/master/docs/api/value-formatter.md#the-percentage-format" target="_self"&gt;valueFormatter module&lt;/A&gt; in &lt;A href="https://github.com/Microsoft/powerbi-visuals-utils-formattingutils" target="_self"&gt;Formatting Utils&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 09:43:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/144288#M4954</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-03-17T09:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187033#M5961</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you managed to get the formatting in your visual, I am in the exact same situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;&lt;SPAN class="pl-smi"&gt;valueFormatter but receiving error "Cannot read property 'valueFormatter' of undefined" in console even for the examples &lt;A title="valueFormatter" href="https://github.com/Microsoft/powerbi-visuals-utils-formattingutils/blob/master/docs/api/value-formatter.md#the-percentage-format" target="_blank"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 13:25:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187033#M5961</guid>
      <dc:creator>abhay03</dc:creator>
      <dc:date>2017-06-02T13:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187040#M5962</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/32018"&gt;@abhay03&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did get it working. This is an example of how I used it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import valueFormatter = powerbi.extensibility.utils.formatting.valueFormatter;

kpiNumber = valueFormatter.create({
                        format: categorical.values[kpiRef].source.format,
                        value: 1001,
                        precision: settings.kpi.decimalPlaces
                    });

kpiNumber.format(kpi)&lt;/PRE&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 13:33:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187040#M5962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-02T13:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187840#M5987</link>
      <description>&lt;P&gt;thanks a lot&amp;nbsp;&lt;A title="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/23932" target="_blank"&gt;@rgodfrey&lt;/A&gt;. that helped.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 08:12:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/187840#M5987</guid>
      <dc:creator>abhay03</dc:creator>
      <dc:date>2017-06-05T08:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/331201#M9810</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;I implemented your code and it works.&amp;nbsp;However, the formatting doesn't change once the&amp;nbsp;visual is displayed. For example, I have a number formatted as a decimal number with&amp;nbsp;3 decimal places. My custom visual shows this value correctly when I use it. But if I change the format to Percentage in the Modelling menu, it doesn't reflect. Did you face the same issue?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 09:43:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/331201#M9810</guid>
      <dc:creator>satishr</dc:creator>
      <dc:date>2018-01-02T09:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/333184#M9861</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/50316"&gt;@satishr&lt;/a&gt;&amp;nbsp;How do you get column format? Do you&amp;nbsp;&lt;STRONG&gt;categorical.values[valueColumnIndex].source.format&lt;/STRONG&gt; to get a column format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ignat Vilesov,&lt;/P&gt;&lt;P&gt;Software Engineer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Microsoft Power BI Custom Visuals&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:pbicvsupport@microsoft.com" target="_blank"&gt;&lt;SPAN&gt;pbicvsupport@microsoft.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 12:31:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/333184#M9861</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-01-05T12:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number Formatting Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/333215#M9865</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17823"&gt;@v-viig&lt;/a&gt;Yes, I'm using&amp;nbsp;categorical.values[valueColumnIndex].source.format to get the format values. I found out that sometimes this value is not available initially. So I had to put a check for its availability before getting the value. Now it works fine. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 13:29:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Number-Formatting-Function/m-p/333215#M9865</guid>
      <dc:creator>satishr</dc:creator>
      <dc:date>2018-01-05T13:29:29Z</dc:date>
    </item>
  </channel>
</rss>

