<?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 Create a measure or calculated column that gives the division between an integer and a text variable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757307#M85295</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a measure or a calculated column that gives me the division between a numeric and a text variable. I don't have access to Power Query and changing data type is blocked for me, so I can only achieve this with DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read many posts. I tried to use CONVERT and VALUE but I am clearly doing something wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two problems:&lt;/P&gt;&lt;P&gt;1. The division between a numeric and text variable (Available Stock / Packing Qty per Box)&lt;/P&gt;&lt;P&gt;2. Even with the creation of this variable would be sucessful, the TOTAL in the end of the table, would also be a division. However, I would like the total to be a sum. I would like the total to give me the total amount of boxes in Stock.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technical Information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Available Stock is a Integer variable in a fact table&lt;/LI&gt;&lt;LI&gt;Packing Qty per Box is a tex variable in a dimension table&lt;/LI&gt;&lt;LI&gt;There is a relation of 1 to many between the dimension and the fact table&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replicated the problem in a dummy file and a screen shot. Could you please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1UIjqIYOInrFE4ym4EbNn2zgD9sE-wQ5H?usp=sharing" target="_self"&gt;Dummy PBI&lt;/A&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 06:57:15 GMT</pubDate>
    <dc:creator>jessicarocha</dc:creator>
    <dc:date>2022-09-09T06:57:15Z</dc:date>
    <item>
      <title>Create a measure or calculated column that gives the division between an integer and a text variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757307#M85295</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a measure or a calculated column that gives me the division between a numeric and a text variable. I don't have access to Power Query and changing data type is blocked for me, so I can only achieve this with DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read many posts. I tried to use CONVERT and VALUE but I am clearly doing something wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two problems:&lt;/P&gt;&lt;P&gt;1. The division between a numeric and text variable (Available Stock / Packing Qty per Box)&lt;/P&gt;&lt;P&gt;2. Even with the creation of this variable would be sucessful, the TOTAL in the end of the table, would also be a division. However, I would like the total to be a sum. I would like the total to give me the total amount of boxes in Stock.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technical Information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Available Stock is a Integer variable in a fact table&lt;/LI&gt;&lt;LI&gt;Packing Qty per Box is a tex variable in a dimension table&lt;/LI&gt;&lt;LI&gt;There is a relation of 1 to many between the dimension and the fact table&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replicated the problem in a dummy file and a screen shot. Could you please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1UIjqIYOInrFE4ym4EbNn2zgD9sE-wQ5H?usp=sharing" target="_self"&gt;Dummy PBI&lt;/A&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 06:57:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757307#M85295</guid>
      <dc:creator>jessicarocha</dc:creator>
      <dc:date>2022-09-09T06:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure or calculated column that gives the division between an integer and a text variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757512#M85308</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323085" data-lia-user-login="jessicarocha" class="lia-mention lia-mention-user"&gt;jessicarocha&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Boxes in Stock = 
SUMX (
    'Material Dimension',
    VAR AvialableStock = SUMX ( RELATEDTABLE ( Stock ), Stock[Available Stock] )
    VAR PackQty = VALUE ( 'Material Dimension'[Packing Qty per Box] )
    RETURN
        DIVIDE ( AvialableStock, PackQty )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Sep 2022 08:04:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757512#M85308</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-09T08:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure or calculated column that gives the division between an integer and a text variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757631#M85328</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;! This is exactly what I need!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I forgot the fact that the stock fact is also connected to a date dimension. I am only interested in the stock representing last week, so I would like to add a filter for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to adapt that in your formula but I can't make it work. I added in the SUMX from the VAR Available Stock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FILTER('Date Dimension', 'Date Dimension'[Week(yyyyWww)]= (YEAR(TODAY()) &amp;amp;"W" &amp;amp; WEEKNUM(TODAY(),21)-1) )&lt;/LI-CODE&gt;&lt;P&gt;But it does not work. I am unsure where to add the filter. Can you also help with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much, really!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 08:34:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757631#M85328</guid>
      <dc:creator>jessicarocha</dc:creator>
      <dc:date>2022-09-09T08:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure or calculated column that gives the division between an integer and a text variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757717#M85336</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323085" data-lia-user-login="jessicarocha" class="lia-mention lia-mention-user"&gt;jessicarocha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Boxes in Stock =
CALCULATE (
    SUMX (
        'Material Dimension',
        VAR AvialableStock =
            SUMX ( RELATEDTABLE ( Stock ), Stock[Available Stock] )
        VAR PackQty =
            VALUE ( 'Material Dimension'[Packing Qty per Box] )
        RETURN
            DIVIDE ( AvialableStock, PackQty )
    ),
    'Date Dimension'[Week(yyyyWww)]
        = YEAR ( TODAY () ) &amp;amp; "W"
            &amp;amp; WEEKNUM ( TODAY (), 21 ) - 1
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Sep 2022 08:58:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757717#M85336</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-09T08:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure or calculated column that gives the division between an integer and a text variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757944#M85353</link>
      <description>&lt;P&gt;Thank you so so much!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 10:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-or-calculated-column-that-gives-the-division/m-p/2757944#M85353</guid>
      <dc:creator>jessicarocha</dc:creator>
      <dc:date>2022-09-09T10:22:29Z</dc:date>
    </item>
  </channel>
</rss>

