<?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: DAys remaining in each fiscal year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAys-remaining-in-each-fiscal-year/m-p/725302#M1521</link>
    <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's something to get you started.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model:&lt;/P&gt;&lt;P&gt;Calendar - Stores dates that cover all years one can find in Projects&lt;/P&gt;&lt;P&gt;Projects - Stores ProjectId, StartDate, EndDate&lt;/P&gt;&lt;P&gt;CurrentDays - Stores a selection of dates that will play the role of TODAY (slicer)&lt;/P&gt;&lt;P&gt;No relationships. All tables stand on their own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;PRE&gt;Remaining Days In Period:=&lt;BR /&gt;var __cutoffDate = 
	if( 
		HASONEVALUE( CurrentDays[CurrentDay] ), 
		VALUES( CurrentDays[CurrentDay] ) 
	)
var __remainingDays =
	SUMX(
		Projects,
		COUNTROWS(
			INTERSECT(
				VALUES( 'Calendar'[Date] ),
				FILTER(
					ALL( 'Calendar'[Date] ),
					'Calendar'[Date] &amp;gt;= __cutoffDate
					&amp;amp;&amp;amp; 'Calendar'[Date] &amp;gt;= Projects[StartDate]
					&amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= Projects[EndDate]
				)
			)
		)
	)
return
	__remainingDays&lt;/PRE&gt;&lt;P&gt;I did this in Excel 2016, so couldn't use the latest functions from PowerBI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 18:09:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-26T18:09:15Z</dc:date>
    <item>
      <title>DAys remaining in each fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAys-remaining-in-each-fiscal-year/m-p/725164#M1517</link>
      <description>&lt;P&gt;I have a project table listing project id's and thier start and end dates. In this table I need to calculate a column (or measure) that tells me for each project how many days it has in each fiscal year. Then ideally I can connect this to the date table so i could show fiscal year on the axis and a count of the days remaining, (summing the days remaining for each project). Ideally it would dynamically adjust for whatever fiscal year we are in but ok with figuring that piece out later.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Level2&lt;/TD&gt;&lt;TD&gt;StartDate&lt;/TD&gt;&lt;TD&gt;EndDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100057&lt;/TD&gt;&lt;TD&gt;11/20/2011&lt;/TD&gt;&lt;TD&gt;4/30/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100227&lt;/TD&gt;&lt;TD&gt;3/31/2019&lt;/TD&gt;&lt;TD&gt;4/1/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101011&lt;/TD&gt;&lt;TD&gt;11/5/2015&lt;/TD&gt;&lt;TD&gt;11/6/2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100227&lt;/TD&gt;&lt;TD&gt;3/31/2019&lt;/TD&gt;&lt;TD&gt;4/1/2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 15:08:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAys-remaining-in-each-fiscal-year/m-p/725164#M1517</guid>
      <dc:creator>Mmahachi</dc:creator>
      <dc:date>2019-06-26T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAys remaining in each fiscal year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAys-remaining-in-each-fiscal-year/m-p/725302#M1521</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's something to get you started.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model:&lt;/P&gt;&lt;P&gt;Calendar - Stores dates that cover all years one can find in Projects&lt;/P&gt;&lt;P&gt;Projects - Stores ProjectId, StartDate, EndDate&lt;/P&gt;&lt;P&gt;CurrentDays - Stores a selection of dates that will play the role of TODAY (slicer)&lt;/P&gt;&lt;P&gt;No relationships. All tables stand on their own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;PRE&gt;Remaining Days In Period:=&lt;BR /&gt;var __cutoffDate = 
	if( 
		HASONEVALUE( CurrentDays[CurrentDay] ), 
		VALUES( CurrentDays[CurrentDay] ) 
	)
var __remainingDays =
	SUMX(
		Projects,
		COUNTROWS(
			INTERSECT(
				VALUES( 'Calendar'[Date] ),
				FILTER(
					ALL( 'Calendar'[Date] ),
					'Calendar'[Date] &amp;gt;= __cutoffDate
					&amp;amp;&amp;amp; 'Calendar'[Date] &amp;gt;= Projects[StartDate]
					&amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= Projects[EndDate]
				)
			)
		)
	)
return
	__remainingDays&lt;/PRE&gt;&lt;P&gt;I did this in Excel 2016, so couldn't use the latest functions from PowerBI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 18:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAys-remaining-in-each-fiscal-year/m-p/725302#M1521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-26T18:09:15Z</dc:date>
    </item>
  </channel>
</rss>

