<?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: Need Help  in number formating by using DAX commands in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2552372#M72277</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, by my test, a calculated column can't get the correct total anyway, but a measure can, because measure can first get the total number then format it.&lt;/P&gt;
&lt;P&gt;I create a sample.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here's my solution, create a measure, use SUM&amp;nbsp;in the formula, not MAX.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR number_ =
    SUM ( [Total Revenue] )
VAR decimal = "0.000"
RETURN
    IF (
        number_ &amp;gt;= 1000000000,
        FORMAT ( number_ / 1000000000, decimal &amp;amp; "B" ),
        IF ( number_ &amp;gt;= 1000000, FORMAT ( number_ / 1000000, decimal &amp;amp; "M" ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Get the correct result.&amp;nbsp;In order for measure to get multiple values, additional columns are required in the visual.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 08:59:30 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-06-01T08:59:30Z</dc:date>
    <item>
      <title>Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2542773#M71680</link>
      <description>&lt;P&gt;Hi ALL,&lt;BR /&gt;&lt;SPAN&gt;I need some help in number formatting in DAX , Below is the scenario &amp;amp; the DAX function which I have written.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have revenue field in my source and as Power Bi represents Billion as "bn" and my client wants it to represent it as "B" , so they want if the numbers are less than 1000 then it represent at $ , if it is less than 1000000 then it should represent as $K , if it less than 1000000000 then it should be representing as $M and anything greater than that would be termed as $B.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what i have written :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"$"&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR number_ =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MAX ([Total Revenue] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR decimal = "0.0"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IF (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;number_ &amp;gt;= 1000000000,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FORMAT ( number_ / 1000000000, decimal &amp;amp; "B" ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IF ( number_ &amp;gt;= 1000000, FORMAT (number_ / 1000000, decimal &amp;amp; "M" ) )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when I create a new column and write a above dax function it is treating as Text and i am not able to summarize it ,&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if I create a new measure then I input the above DAX function then it is not even allowing me to change the format from Text to Decimal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly Please help!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shiv&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 05:10:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2542773#M71680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-27T05:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2543175#M71690</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , first create a measure and do that formatting there. It will text measure but will work &lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 08:18:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2543175#M71690</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-05-27T08:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545301#M71824</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I have followed the way you mentioned but when i create a bar chart with the measure , it is not giving me any data as it is text field.&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Shiv Kumar&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 13:57:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545301#M71824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-28T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545562#M71876</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;You can format :&lt;/P&gt;&lt;P&gt;To Format to $1.56B&lt;/P&gt;&lt;P&gt;Measure = format(1558753918,"$#,,,.##B")&amp;nbsp; &amp;nbsp; * place measure instead of 1558753918.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 20:41:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545562#M71876</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-28T20:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545730#M71883</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;If you new to format text to number. In DAX usually INT or VALUES function can helpful. I think you can use a SWITCH statement. I did a little reseach on how to Format like you mentioned and found the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To Format to $1.56B&lt;/P&gt;&lt;P&gt;Measure = format(1558753918,"$#,,,.##B")&amp;nbsp; the number can be substituted for your measure. I have other examples below.&amp;nbsp; I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;img /&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;&lt;P&gt;"Currency (2)", FORMAT (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1234.567, """US$"" #,0.00" )&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Currency (2)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;US$ 1,234.57&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Millions:&lt;/P&gt;&lt;P&gt;Sales to (M) = FORMAT([Sales Amount], "#,##,,.0M")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2,715.3M&lt;/P&gt;&lt;P&gt;Sales to (M) = FORMAT([Sales Amount], "#,##,,M") &amp;nbsp;&amp;nbsp;&amp;nbsp;=2,715M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;Europe:&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;FORMAT(MuMeasure[EU], "#,##,,.0M")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thousands&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales to (K) = FORMAT([Sales Amount], "#,##,K")&amp;nbsp;&amp;nbsp; =205K&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales to (K) = FORMAT([Sales Amount], "#,##,.0K") put it to one decimal&amp;nbsp;&amp;nbsp; 294.8k vs 294801&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 01:12:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2545730#M71883</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-29T01:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help  in number formating by using DAX commands</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2552372#M72277</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, by my test, a calculated column can't get the correct total anyway, but a measure can, because measure can first get the total number then format it.&lt;/P&gt;
&lt;P&gt;I create a sample.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here's my solution, create a measure, use SUM&amp;nbsp;in the formula, not MAX.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR number_ =
    SUM ( [Total Revenue] )
VAR decimal = "0.000"
RETURN
    IF (
        number_ &amp;gt;= 1000000000,
        FORMAT ( number_ / 1000000000, decimal &amp;amp; "B" ),
        IF ( number_ &amp;gt;= 1000000, FORMAT ( number_ / 1000000, decimal &amp;amp; "M" ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Get the correct result.&amp;nbsp;In order for measure to get multiple values, additional columns are required in the visual.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 08:59:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-in-number-formating-by-using-DAX-commands/m-p/2552372#M72277</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-01T08:59:30Z</dc:date>
    </item>
  </channel>
</rss>

