<?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: Calculated Measure not Summing in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2308102#M57275</link>
    <description>&lt;P&gt;This worked, I used this website to reach my solution:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://finance-bi.com/blog/power-bi-totals-incorrect/" target="_blank"&gt;https://finance-bi.com/blog/power-bi-totals-incorrect/&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Linqto Bucks Promotional Cost = 
var summarizedTable = ADDCOLUMNS ( 
SUMMARIZE ( Orders, Orders[User Id]), 
"Qualifying Orders", CALCULATE ( COUNTA(Orders[24 Rolling]), Orders[24 Rolling]=TRUE(), Orders[Payment Type]="Wire"))
return
SUMX(summarizedTable,
IF([Qualifying Orders]=2, 1000, 
IF([Qualifying Orders]=3, 2000,
IF([Qualifying Orders]&amp;gt;3, 3000,BLANK()))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 16:27:16 GMT</pubDate>
    <dc:creator>ruesaint_denis</dc:creator>
    <dc:date>2022-01-28T16:27:16Z</dc:date>
    <item>
      <title>Calculated Measure not Summing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2306502#M57153</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a calculated measure and for some reason it's not summing correctly. This is my measure, and below you can see the results:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Linqto Bucks Promotional Cost = 
Var true_24 = calculate(COUNTA(Orders[24 Rolling]), Orders[24 Rolling]=TRUE(), Orders[Payment Type]="Wire")
return
IF(true_24 = 2, 1000, IF(true_24=3, 2000, IF(true_24&amp;gt;3, 5000, 0)))&lt;/LI-CODE&gt;&lt;P&gt;Orders[24 Rolling] is a Boolean True/False Column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to see if there's &lt;FONT color="#FF0000"&gt;X&lt;/FONT&gt; amount of&amp;nbsp;Orders[24 Rolling] = True &amp;amp;&amp;amp; Orders[Payment Type]="Wire" , then assign certain value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see the sum isn't working at the end. Any ideas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 01:52:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2306502#M57153</guid>
      <dc:creator>ruesaint_denis</dc:creator>
      <dc:date>2022-01-28T01:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure not Summing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2306530#M57156</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313840" data-lia-user-login="ruesaint_denis" class="lia-mention lia-mention-user"&gt;ruesaint_denis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share a samole of your data table in a text format. BTW, check this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total" target="_blank"&gt;https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 02:06:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2306530#M57156</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2022-01-28T02:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure not Summing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2308013#M57265</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really not getting it. My data looks as the following:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;User ID&lt;/TD&gt;&lt;TD&gt;Order ID&lt;/TD&gt;&lt;TD&gt;24hr Rolling&lt;/TD&gt;&lt;TD&gt;Payment Method&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;True&lt;/TD&gt;&lt;TD&gt;Uphold&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;105&lt;/TD&gt;&lt;TD&gt;False&lt;/TD&gt;&lt;TD&gt;Wire&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;True&lt;/TD&gt;&lt;TD&gt;Wire&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;204&lt;/TD&gt;&lt;TD&gt;True&lt;/TD&gt;&lt;TD&gt;Wire&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;True&lt;/TD&gt;&lt;TD&gt;Uphold&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;303&lt;/TD&gt;&lt;TD&gt;True&lt;/TD&gt;&lt;TD&gt;Wire&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The desired output is the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- filter for orders where payment method = wire, and 24hr rolling = True, groupby user ID&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;calculate promotional cost with different IF statements&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if count of 2hr rolling = 2, then 1000&lt;/P&gt;&lt;P&gt;if count of 2hr rolling = 3, then 2000&lt;/P&gt;&lt;P&gt;if count of 2hr rolling &amp;gt; 3, then 5000&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;User ID&lt;/TD&gt;&lt;TD&gt;Sum of Count of 24hr Rolling&amp;nbsp;&lt;BR /&gt;where 24hr rolling = True&lt;/TD&gt;&lt;TD&gt;Promotional Cost&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to calculate the appropriate promotional cost for each user ID, but the summing isn't working using this DAX measure:&amp;nbsp;&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;Linqto Bucks Promotional Cost = 
Var true_24 = calculate(COUNTA(Orders[24 Rolling]), Orders[24 Rolling]=TRUE(), Orders[Payment Type]="Wire")
return
IF(true_24 = 2, 1000, IF(true_24=3, 2000, IF(true_24&amp;gt;3, 5000, 0)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 15:31:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2308013#M57265</guid>
      <dc:creator>ruesaint_denis</dc:creator>
      <dc:date>2022-01-28T15:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure not Summing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2308102#M57275</link>
      <description>&lt;P&gt;This worked, I used this website to reach my solution:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://finance-bi.com/blog/power-bi-totals-incorrect/" target="_blank"&gt;https://finance-bi.com/blog/power-bi-totals-incorrect/&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Linqto Bucks Promotional Cost = 
var summarizedTable = ADDCOLUMNS ( 
SUMMARIZE ( Orders, Orders[User Id]), 
"Qualifying Orders", CALCULATE ( COUNTA(Orders[24 Rolling]), Orders[24 Rolling]=TRUE(), Orders[Payment Type]="Wire"))
return
SUMX(summarizedTable,
IF([Qualifying Orders]=2, 1000, 
IF([Qualifying Orders]=3, 2000,
IF([Qualifying Orders]&amp;gt;3, 3000,BLANK()))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 16:27:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-not-Summing/m-p/2308102#M57275</guid>
      <dc:creator>ruesaint_denis</dc:creator>
      <dc:date>2022-01-28T16:27:16Z</dc:date>
    </item>
  </channel>
</rss>

