<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: SQL Server: Database Mirroring Interview Questions and Answers (Day-2)	</title>
	<atom:link href="https://www.dbrnd.com/2016/05/sql-server-database-mirroring-interview-questions-and-answers-day-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2016/05/sql-server-database-mirroring-interview-questions-and-answers-day-2/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 23 Apr 2018 09:04:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Morgan		</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-database-mirroring-interview-questions-and-answers-day-2/#comment-6387</link>

		<dc:creator><![CDATA[Morgan]]></dc:creator>
		<pubDate>Mon, 23 Apr 2018 09:04:23 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2994#comment-6387</guid>

					<description><![CDATA[Hi Anvesh Patel,


You make learning and reading addictive. All eyes fixed on you. Thank you being such a good and trust worthy guide.

I have a data table with 80M records that looks like any other typical Sales Fact with  fields like DateID, ProductID, SupplierID,QuantitySold and I am trying to write a DAX calculation that gives me the QuantitySold in past 30/60/90 days.
The catch is if the month is part done (example: April 15th), then this measure should show only until that day as the total at the month level instead of as of last day of the month.
I have tried many ways and finally ended up on this as it was working perfectly:
QtySold_Running30days:=
  
VAR MaxDate = LASTDATE(FactSales[SaleDt])

RETURN
CALCULATE([QuantitySold],
FILTER(ALL(&#039;Date&#039;),
&#039;Date&#039;[Date] &#062; DataMaxDate -30 &#038;&#038;
&#039;Date&#039;[Date] &#060; DataMaxDate))
Having said that, the reports that have all these 3 measures along with Date / Product and Supplier Attributes is not returning data even with the bare minimum filters. 

Thank you very much and will look for from you.


Thank you, 
Morgan]]></description>
			<content:encoded><![CDATA[<p>Hi Anvesh Patel,</p>
<p>You make learning and reading addictive. All eyes fixed on you. Thank you being such a good and trust worthy guide.</p>
<p>I have a data table with 80M records that looks like any other typical Sales Fact with  fields like DateID, ProductID, SupplierID,QuantitySold and I am trying to write a DAX calculation that gives me the QuantitySold in past 30/60/90 days.<br />
The catch is if the month is part done (example: April 15th), then this measure should show only until that day as the total at the month level instead of as of last day of the month.<br />
I have tried many ways and finally ended up on this as it was working perfectly:<br />
QtySold_Running30days:=</p>
<p>VAR MaxDate = LASTDATE(FactSales[SaleDt])</p>
<p>RETURN<br />
CALCULATE([QuantitySold],<br />
FILTER(ALL(&#8216;Date&#8217;),<br />
&#8216;Date'[Date] &gt; DataMaxDate -30 &amp;&amp;<br />
&#8216;Date'[Date] &lt; DataMaxDate))<br />
Having said that, the reports that have all these 3 measures along with Date / Product and Supplier Attributes is not returning data even with the bare minimum filters. </p>
<p>Thank you very much and will look for from you.</p>
<p>Thank you,<br />
Morgan</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
