<?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 DAX Measure to distribute a total value linearly over months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958420#M11090</link>
    <description>&lt;P&gt;Hello dear Power BI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find the answer for the following question anywhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a total value to the amount of 180 as the average of the entire year.&lt;/P&gt;&lt;P&gt;It is my aim to distribute this value linearly over months (180/12).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result shold look like:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;January = 15&lt;/P&gt;&lt;P&gt;February = 15&lt;/P&gt;&lt;P&gt;March = 15&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total = 180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve the Problem with DAX? Or something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many Thanks!&lt;/SPAN&gt;&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;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2020 09:45:06 GMT</pubDate>
    <dc:creator>Cakos</dc:creator>
    <dc:date>2020-03-04T09:45:06Z</dc:date>
    <item>
      <title>DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958420#M11090</link>
      <description>&lt;P&gt;Hello dear Power BI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find the answer for the following question anywhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a total value to the amount of 180 as the average of the entire year.&lt;/P&gt;&lt;P&gt;It is my aim to distribute this value linearly over months (180/12).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result shold look like:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;January = 15&lt;/P&gt;&lt;P&gt;February = 15&lt;/P&gt;&lt;P&gt;March = 15&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total = 180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve the Problem with DAX? Or something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many Thanks!&lt;/SPAN&gt;&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;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:45:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958420#M11090</guid>
      <dc:creator>Cakos</dc:creator>
      <dc:date>2020-03-04T09:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958590#M11098</link>
      <description>&lt;P&gt;add months in table visual and add below measure,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MEasure=sum([value])/count(table[months])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 11:44:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958590#M11098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-04T11:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958679#M11103</link>
      <description>Where do you want to do this? In a visual or in a model table as a calculated column maybe? If in a visual, what should be displayed for granularities other than months?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Wed, 04 Mar 2020 12:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/958679#M11103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-04T12:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970457#M11584</link>
      <description>&lt;P&gt;Thx for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do this in a visual.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example I created different DAX measures to calculate with different tables in the model.&lt;/P&gt;&lt;P&gt;I want to distribute the total value of Measure 4 (168,23) linearely other months&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The outcome should be look like:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Measure 6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;January&lt;/TD&gt;&lt;TD&gt;14,02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;February&lt;/TD&gt;&lt;TD&gt;14,02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;14,02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;December&lt;/TD&gt;&lt;TD&gt;14,02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;total&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;168,23&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that possible?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 08:37:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970457#M11584</guid>
      <dc:creator>Cakos</dc:creator>
      <dc:date>2020-03-12T08:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970496#M11586</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212534" data-lia-user-login="Cakos" class="lia-mention lia-mention-user"&gt;Cakos&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i guess your Measure 6 should look like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Measure 6=
var TotalMeasure4 =
	CALCULATE([Measure 4], ALL('&amp;lt;tablename&amp;gt;'[Monthcolumn]))
return
TotalMeasure4 / 12&lt;/LI-CODE&gt;
&lt;P&gt;Hopefully, this provides what you are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 08:56:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970496#M11586</guid>
      <dc:creator>TomMartens</dc:creator>
      <dc:date>2020-03-12T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970548#M11588</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="31" data-lia-user-login="TomMartens" class="lia-mention lia-mention-user"&gt;TomMartens&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try your recommended DAX measure it looks not bad but this is not the right outcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have another idea?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 09:23:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970548#M11588</guid>
      <dc:creator>Cakos</dc:creator>
      <dc:date>2020-03-12T09:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970823#M11601</link>
      <description>Hi there.&lt;BR /&gt;&lt;BR /&gt;Hold on, mate, I'm writing the general measure that will work on any level of the Calendar by linear apportioning of the value from the year.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Thu, 12 Mar 2020 12:34:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970823#M11601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-12T12:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970866#M11603</link>
      <description>&lt;LI-CODE lang="markup"&gt;// Say you have a measure
// that calculates correctly
// on the year level but not
// on any other higher granularity.
// Such a measure should be hidden.
// Note the underscore - it indicates
// this is a hidden auxiliary measure
// and should not be used by the end
// user.

[_Measure] = sum( FactTable[Amount] )

// Below is a measure that calculates
// correctly on any level by apportioning
// of the above.

// Assumption is that Calendar (the Date
// table in your model has these levels:
// 1. Year
// 2. Semester
// 2. Quarter
// 3. Month
// 4. Date
// This is a hierarchy and for each level
// you have to apportion the measure
// linearly.

[Measure] =
var __year = values( Calendar[Year] )
var __yearTotal =
	calculate(
		[_Measure],
		__year
	)		
var __periodsInYear =
	switch( true(),
	
		isinscope( Calendar[Date] ),
			calculate(
				countrows( 'Calendar' ),
				__year
			),
				
		isinscope( Calendar[Month] ), 12,
		isinscope( Calendar[Quarter] ), 4,
		isinscope( Calendar[Semester] ), 2,
		isinscope( Calendar[Year] ), 1,
		
		// If nothing is in scope, we'll calculate on the day
		// level. Bear in mind, that the total might be across
		// more than 1 year, so we have to sum up the portions
		// for each year on the day level.
		-1
		
	)
var __apportionByDate =
	// This could be coded in a more performant fashion
	// but it may not be needed.
	sumx(
		values( Calendar[Date] ),
		var __year =
			calculatetable(
				values( Calendar[Year] )
			)
		var __daysInYear =
			calculate(
				countrows( 'Calendar' ),
				__year,
				all( 'Calendar' )
			)
		var __yearTotal =
			calculate(
				[_Measure],
				__year,
				all( 'Calendar' )
			)
		var __dayTotal =
			divide( __yearTotal, __daysInYear )
		return
			__dayTotal
	)
var __result =
	switch( true(),	
		__periodsInYear &amp;gt; 0, divide( __yearTotal, __periodsInYear ),
		__apportionByDate
	)
return
	__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the above. Remember that Calendar is your date dimension (and marked as such in the model) and slicing should only ever be done via dimensions, never directly on a fact table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 13:12:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970866#M11603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-12T13:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Measure to distribute a total value linearly over months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970966#M11610</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;and all others,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:24:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Measure-to-distribute-a-total-value-linearly-over-months/m-p/970966#M11610</guid>
      <dc:creator>Cakos</dc:creator>
      <dc:date>2020-03-12T14:24:20Z</dc:date>
    </item>
  </channel>
</rss>

