<?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: rounding decimals in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222618#M52808</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to use calculation groups for this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/" target="_blank"&gt;https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 10:17:14 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2021-12-06T10:17:14Z</dc:date>
    <item>
      <title>rounding decimals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222553#M52803</link>
      <description>&lt;P&gt;i have a dax formula that calculate a cost per unit(spending divided by quantity). but when filter is applied for certain category such as , if category for food or beverages is selected, the cost per unit calculated by the dax formula should be showing 4 decimals place, if other category is selected it should show 2 decimals places. how should the DAX formula be written?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 09:46:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222553#M52803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-06T09:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: rounding decimals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222615#M52806</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Actually Might have to use format, but that might make it text &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(max(table[Category] in {"food","beverages"}, Format([Measure], #,###.0000) , Format([Measure], #,###.00)&amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 10:13:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222615#M52806</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-12-06T10:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: rounding decimals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222618#M52808</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to use calculation groups for this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/" target="_blank"&gt;https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 10:17:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2222618#M52808</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-12-06T10:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: rounding decimals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2229513#M53167</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = var price_each=DIVIDE(SELECTEDVALUE('Table'[spend]),SELECTEDVALUE('Table'[quantity]))
var result= IF(SELECTEDVALUE('Table'[category])in {"food","drink"},FORMAT(price_each,"0.0000"),FORMAT(price_each,"0.00"))
return result&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 06:52:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rounding-decimals/m-p/2229513#M53167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-09T06:52:56Z</dc:date>
    </item>
  </channel>
</rss>

