<?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: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295586#M122780</link>
    <description>&lt;P&gt;Genious, this look good and simple after recording. thx&lt;/P&gt;&lt;P&gt;but pbi throws an error for ur code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 12:34:35 GMT</pubDate>
    <dc:creator>Power-CJ</dc:creator>
    <dc:date>2023-06-21T12:34:35Z</dc:date>
    <item>
      <title>Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3294978#M122725</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am stucking here in a issue, which i know that the solution is too easy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 Columns:&lt;/P&gt;&lt;P&gt;- articlenumber&lt;/P&gt;&lt;P&gt;- Month-Year&lt;/P&gt;&lt;P&gt;- salesamount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is another Table i genarted with DAX with 2 Columns:&lt;/P&gt;&lt;P&gt;- articlenumber from the first table i mentioned&amp;nbsp;&lt;/P&gt;&lt;P&gt;- dates from a date-table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i got a new table with the sold articles and all days of a year without a salesamount:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Simulation = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CROSSJOIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'&lt;/SPAN&gt;&lt;SPAN&gt;[Artikel]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALENDAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date-Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date-Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)), &lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;31&lt;/SPAN&gt;&lt;SPAN&gt;))),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"SKUs"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Sales)'&lt;/SPAN&gt;&lt;SPAN&gt;[Artikel]&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Datum"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now i need a third column in which i will put a calculation. Therefor i want to divide the salesamount (1. Table) of one month by the days of that month and put that distribution in each day of the month in a new column of the 2. Table.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank for helping me with this problem&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 08:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3294978#M122725</guid>
      <dc:creator>Power-CJ</dc:creator>
      <dc:date>2023-06-21T08:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295208#M122746</link>
      <description>&lt;P&gt;You could build the table with&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Daily Table =
SELECTCOLUMNS (
    GENERATE (
        'Sales',
        VAR StartDate = 'Sales'[Year month]
        VAR EndDate =
            EOMONTH ( 'Sales'[Year month], 0 )
        VAR DatesInMonth =
            CALENDAR ( StartDate, EndDate )
        VAR NumDays =
            COUNTROWS ( DatesInMonth )
        VAR DailyAmount =
            DIVIDE ( 'Sales'[Sales amount], NumDays )
        RETURN
            ADDCOLUMNS ( DatesInMonth, "Daily Amount", DailyAmount )
    ),
    "SKUs", 'Sales'[Artikel],
    "Datum", [Date],
    "Daily Amount", [Daily Amount]
)
&lt;/LI-CODE&gt;
&lt;P&gt;This assumes that your year month column is actually a date type giving the first of the month. If its in a different format you would need to tweak the StartDate and EndDate variables accordingly.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 10:08:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295208#M122746</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-21T10:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295252#M122752</link>
      <description>&lt;P&gt;VAR Currmonth = 'Tablename2'[Month]&lt;BR /&gt;VAR Days = CALCULATE(COUNTROWS('Tablename2'), 'Tablename2'[Month] = Currmonth)&lt;BR /&gt;VAR currsales = SUMX( FILTER('TableName1' ,'TableName1'[Month] = Currmonth ), [SaleAmount])&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; currsales / Days&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 10:26:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295252#M122752</guid>
      <dc:creator>devanshi</dc:creator>
      <dc:date>2023-06-21T10:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295516#M122774</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for the fast reply.&lt;/P&gt;&lt;P&gt;But i cant use this code.&lt;/P&gt;&lt;P&gt;The Variable currmonth i cant declare like this&lt;/P&gt;&lt;P&gt;how can i use countrows on tablename2 in the variable days if this table is not yet generated.&lt;/P&gt;&lt;P&gt;or i didnt understand the logic of your code?&lt;/P&gt;&lt;P&gt;Where i hava to put this in my existing code of the calculated table 'Simulation'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:03:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295516#M122774</guid>
      <dc:creator>Power-CJ</dc:creator>
      <dc:date>2023-06-21T12:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295586#M122780</link>
      <description>&lt;P&gt;Genious, this look good and simple after recording. thx&lt;/P&gt;&lt;P&gt;but pbi throws an error for ur code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295586#M122780</guid>
      <dc:creator>Power-CJ</dc:creator>
      <dc:date>2023-06-21T12:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295617#M122781</link>
      <description>&lt;P&gt;Can you post the code you are using ?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:50:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295617#M122781</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-21T12:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Easy CALCULATED TABLE - Separate Monthly Sales into Day Amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295690#M122786</link>
      <description>&lt;P&gt;i found the mistake or the fixing&lt;/P&gt;&lt;P&gt;i declare the variable like following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; _EndDate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(_StartDate, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;now it works&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Jun 2023 13:30:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Easy-CALCULATED-TABLE-Separate-Monthly-Sales-into-Day-Amount/m-p/3295690#M122786</guid>
      <dc:creator>Power-CJ</dc:creator>
      <dc:date>2023-06-21T13:30:36Z</dc:date>
    </item>
  </channel>
</rss>

