<?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: SUMX/Calculate Table on data range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275983#M55558</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="174134" data-lia-user-login="Jerry-P4P" class="lia-mention lia-mention-user"&gt;Jerry-P4P&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd recommend unpivotting the data in Power Query.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;That will get you a table with a single Date column (which you currently have as separate columns) with a corresponding Amount column.&lt;/P&gt;
&lt;P&gt;Your measure is then&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Amount = SUM(Table[Amount])&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 10 Jan 2022 17:50:43 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2022-01-10T17:50:43Z</dc:date>
    <item>
      <title>SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275728#M55549</link>
      <description>&lt;P&gt;Good day community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add some values from different colums into a total value. Sadly I don't seem to get it to work..&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the screenshot you can see what I am trying to achieve. I want to make a new Colum where the Total value is displayed (The red part of the printscreen). I need to sum the values of the data rows together, but I need to not include the Text columns( Columns 10 &amp;amp; 9). Obviously the range goes for the whole year, so I don't want to manually put all the columns in the formula, because that would be kinda a waste of time. (Certainly when it comes to more then 1 year&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it first with Calculate(SUMX(TableName,ALLEXPECT(TableName,Columns), but still then I get the error about multiple columns cannot be converted to a scalar value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Ps. I did already change the format of the values to decimal numbers. Still I keep getting this error:&amp;nbsp;Th&lt;U&gt;e expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Jerry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 15:44:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275728#M55549</guid>
      <dc:creator>Jerry-P4P</dc:creator>
      <dc:date>2022-01-10T15:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275783#M55551</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="174134" data-lia-user-login="Jerry-P4P" class="lia-mention lia-mention-user"&gt;Jerry-P4P&lt;/a&gt; ,&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275783#M55551</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-10T16:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275983#M55558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="174134" data-lia-user-login="Jerry-P4P" class="lia-mention lia-mention-user"&gt;Jerry-P4P&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd recommend unpivotting the data in Power Query.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;That will get you a table with a single Date column (which you currently have as separate columns) with a corresponding Amount column.&lt;/P&gt;
&lt;P&gt;Your measure is then&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Amount = SUM(Table[Amount])&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 Jan 2022 17:50:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2275983#M55558</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-01-10T17:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2276120#M55566</link>
      <description>&lt;P&gt;Hi What Paul said is good.&lt;/P&gt;&lt;P&gt;One minor add on is you will want to click the top of each text column in PQ then choose for the drop down "Unpivot Other Columns"&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;Highlight all those data columns only and "Unpivot Columns". Then you just have to sum up one column to get your total as&amp;nbsp; suggested.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 19:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2276120#M55566</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-01-10T19:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2280484#M55787</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="174134" data-lia-user-login="Jerry-P4P" class="lia-mention lia-mention-user"&gt;Jerry-P4P&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;We do not so recommend you to store the date values in columns, a table with too many columns should affect the performance.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/power-bi-optimization" target="_blank"&gt;Optimization guide for Power BI - Power BI | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;In addition, power bi is not suitable to directly calculate across multiple columns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;For this scenario, I'd like to suggest you refer to the following link to 'unpivot column' the date fields, then you can simply calculate and summary these field values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f588221c7098#:~:text=Unpivot%20only%20selected%20columns&amp;amp;text=select%20Query%20%3E%20Edit.-,For%20more%20information%20see%20Create%2C%20load%2C%20or%20edit%20a%20query,Transform%20%3E%20Unpivot%20Only%20Selected%20Columns." target="_blank"&gt;Unpivot columns (Power Query) (microsoft.com)&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 01:20:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2280484#M55787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-13T01:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX/Calculate Table on data range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2283310#M55907</link>
      <description>&lt;P&gt;Thanks for your responses!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seem to be working so far when I use unpivot columns on all the date columns!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 08:17:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-Calculate-Table-on-data-range/m-p/2283310#M55907</guid>
      <dc:creator>Jerry-P4P</dc:creator>
      <dc:date>2022-01-14T08:17:30Z</dc:date>
    </item>
  </channel>
</rss>

