<?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 Calculate a cumulative year to date and a avg month for year to date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/93919#M147</link>
    <description>&lt;P&gt;&lt;BR /&gt;I am trying to get to the following output:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;based on a list of amounts througout the month&lt;/P&gt;&lt;P&gt;Table 'Ledger'&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActualDollars&lt;BR /&gt;1/3/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;1/25/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;1/31/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&lt;BR /&gt;2/6/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;2/10/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 39&lt;BR /&gt;2/25/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;3/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;4/2/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;BR /&gt;4/20/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;5/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;5/15/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;5/20/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;6/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;6/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;6/23/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&lt;BR /&gt;7/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;8/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;8/12/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;BR /&gt;9/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27&lt;BR /&gt;9/3/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&lt;BR /&gt;9/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;10/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;BR /&gt;10/17/2016&amp;nbsp; 15&lt;BR /&gt;10/30/2016&amp;nbsp;&amp;nbsp; 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a related date table with a full date like 'Ledger_GLDJ'[full_date]. The first column is easy as its just a sum of the individual charges in that month. I got the cumulative actual to work, even though I not sure that is the correct way to do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Actual = TOTALYTD(SUM(Ledger[ActualDollars]),Ledger[GLDGJ],FILTER(ALL(Ledger_GLDJ[full_date]),Ledger_GLDJ[full_date] &amp;lt;= MAX(Ledger_GLDJ[full_date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot figure out how to get the last column, average month (based only in the current year). In principle, this would be the Cumulative Actual for a given month / the month count. So in the first month, I would be dividing cumulative total by 1, in the second month I would be dividing the new cumulative total by 2, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any one able to help on this?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Nov 2016 04:38:03 GMT</pubDate>
    <dc:creator>rwhitworth</dc:creator>
    <dc:date>2016-11-25T04:38:03Z</dc:date>
    <item>
      <title>Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/93919#M147</link>
      <description>&lt;P&gt;&lt;BR /&gt;I am trying to get to the following output:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;based on a list of amounts througout the month&lt;/P&gt;&lt;P&gt;Table 'Ledger'&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActualDollars&lt;BR /&gt;1/3/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;1/25/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;1/31/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&lt;BR /&gt;2/6/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;2/10/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 39&lt;BR /&gt;2/25/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;3/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;4/2/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;BR /&gt;4/20/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;5/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;5/15/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;5/20/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;6/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;6/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;6/23/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&lt;BR /&gt;7/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;8/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;BR /&gt;8/12/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;BR /&gt;9/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27&lt;BR /&gt;9/3/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&lt;BR /&gt;9/5/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&lt;BR /&gt;10/1/2016&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;BR /&gt;10/17/2016&amp;nbsp; 15&lt;BR /&gt;10/30/2016&amp;nbsp;&amp;nbsp; 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a related date table with a full date like 'Ledger_GLDJ'[full_date]. The first column is easy as its just a sum of the individual charges in that month. I got the cumulative actual to work, even though I not sure that is the correct way to do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Actual = TOTALYTD(SUM(Ledger[ActualDollars]),Ledger[GLDGJ],FILTER(ALL(Ledger_GLDJ[full_date]),Ledger_GLDJ[full_date] &amp;lt;= MAX(Ledger_GLDJ[full_date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot figure out how to get the last column, average month (based only in the current year). In principle, this would be the Cumulative Actual for a given month / the month count. So in the first month, I would be dividing cumulative total by 1, in the second month I would be dividing the new cumulative total by 2, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any one able to help on this?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 04:38:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/93919#M147</guid>
      <dc:creator>rwhitworth</dc:creator>
      <dc:date>2016-11-25T04:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/94216#M148</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create MonthInt:&amp;nbsp;MonthInt = month(Ledger[Date].[Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create Calculated Column:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;YTD - Total = Calculate(sum('Ledger'[ActualDollars]),FILTER(Ledger, Ledger[MonthInt]&amp;lt;=EARLIER(Ledger[MonthInt]) ) )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;As my observation, the DAX above will generate same accumulative total result in each month&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;img&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;&lt;EM&gt;so you need to choose Maximum or Minimum or Average in the Fields properties to visualize:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(i will choose maximum)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Create Calculated Column by divided for distinctcount of month :&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;YTD - Avg = Calculate(SUM(Ledger[ActualDollars])/DISTINCTCOUNT(Ledger[MonthInt]),FILTER(Ledger, Ledger[MonthInt]&amp;lt;=EARLIER(Ledger[MonthInt]) ) )&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And choose Don't summarize&amp;nbsp;for that YTD - AVG value:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&amp;nbsp;&lt;FONT color="#0000FF"&gt;Please notice that if you add filter/slicer by Date level, when you select filters the result could be wrong in this scenario.&lt;BR /&gt;Or you could summarize(groupby) your data to another calculated table to ensure month is the lowest level of group by, then use the first expression.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 08:36:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/94216#M148</guid>
      <dc:creator>tringuyenminh92</dc:creator>
      <dc:date>2016-11-26T08:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/94379#M152</link>
      <description>Thank you for taking the time to answer this. I plan to try it out tomorrow and will let you know how it works.</description>
      <pubDate>Sun, 27 Nov 2016 04:44:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/94379#M152</guid>
      <dc:creator>rwhitworth</dc:creator>
      <dc:date>2016-11-27T04:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97025#M159</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17420" data-lia-user-login="rwhitworth" class="lia-mention lia-mention-user"&gt;rwhitworth﻿&lt;/a&gt;&amp;nbsp;Hope this approach help to solve your problem. please kindly mark this as solution if it's working for your case.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 17:12:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97025#M159</guid>
      <dc:creator>tringuyenminh92</dc:creator>
      <dc:date>2016-12-02T17:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97039#M160</link>
      <description>&lt;P&gt;i will mark it correct. you answered the question I asked. However, I have determined I have a new problem, I simplified the data set too much for the example. I actually need cumulative and monthly average by month AND by category. not sure how to do this.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 18:00:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97039#M160</guid>
      <dc:creator>rwhitworth</dc:creator>
      <dc:date>2016-12-02T18:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a cumulative year to date and a avg month for year to date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97048#M161</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17420" data-lia-user-login="rwhitworth" class="lia-mention lia-mention-user"&gt;rwhitworth﻿&lt;/a&gt;&amp;nbsp;In that case, you need to use Calculated Measure in another approach (sorry for above solution cause it's my favorite solution)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a date table -&amp;gt; Go to Modelling click New Table -&amp;gt; enter Dates = CALENDARAUTO()&lt;/LI&gt;&lt;LI&gt;Create Relantionship between your Ledger[Date] and Dates[Date] ( the calculated table)&lt;/LI&gt;&lt;LI&gt;Ensure your data has all 12 months (Nov and Dec should have 0 instead of no data)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Create measure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Cumulative Actual = CALCULATE(sum(Ledger[ActualDollars]),FILTER(ALL(Dates[Date]),Dates[Date]&amp;lt;=MAX(Dates[Date]) ))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Avg Actual = CALCULATE(sum(Ledger[ActualDollars])/DISTINCTCOUNT(Ledger[Month]),FILTER(ALL(Dates[Date]),Dates[Date]&amp;lt;=MAX(Dates[Date]) ))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;img&gt;﻿&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2016 03:45:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-a-cumulative-year-to-date-and-a-avg-month-for-year-to/m-p/97048#M161</guid>
      <dc:creator>tringuyenminh92</dc:creator>
      <dc:date>2016-12-03T03:45:20Z</dc:date>
    </item>
  </channel>
</rss>

