Comments for Kasper de Jonge PowerPivot and Power BI Blog » Kasper de Jonge PowerPivot and Power BI Blog http://www.powerpivotblog.nl All about BI, modelling and DAX for PowerPivot and Power BI Fri, 24 Apr 2015 17:30:00 +0000 hourly 1 http://wordpress.org/?v=4.1.3 Comment on Ask your questions here by Ben http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212181 Fri, 24 Apr 2015 17:30:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212181 This is the T-SQL to get the result that I need in DAX:

SELECT SUM(deferredincomecp) as totaldeferredincome

FROM

(

SELECT cpaccountid, Max(recognitiondate) maxrecdate

FROM [CarePayment].[DWFin].[vwCPAccountRevenueRecognition]

GROUP BY cpaccountid

) A

JOIN [CarePayment].[DWFin].[vwCPAccountRevenueRecognition] B

ON B.RecognitionDate = a.maxrecdate and a.cpaccountid = b.cpaccountid

WHERE b.recognitiondate <= getdate()

]]>
Comment on Ask your questions here by Ben http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212161 Thu, 23 Apr 2015 23:14:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212161 Hi Kasper,

The image I posted is a sample data set, where only a portion of the accounts (CPAccountID) have records on 3/2/2014, but I want the closing balance for the last day (or prior), so the accounts with records on 3/1/2014 will be excluded if use the following =Calculate(SUM([DeferredIncomeCP]),LASTDATE(DimDate[FullDate])). All of the DAX I’ve tried, including the CLOSINGBALANCE function will only aggregate records that have a transaction on the last day of the period. I need to aggregate the sum of the last value for each account on the last day of period in the context OR prior to the last day. It’s the ones that are in the prior bucket that are getting excluded.
Thanks in advance for your help!

]]>
Comment on Ask your questions here by Kasper de Jonge http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212151 Thu, 23 Apr 2015 23:00:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212151 Can you give me a sample dataset? just a few lines. I think I understand but that would give me the opportunity to test it myself.

]]>
Comment on Ask your questions here by Ben http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212141 Thu, 23 Apr 2015 22:32:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212141 The problem with the closingbalance function is that it only aggregates accounts that have a record for the last day of month, quarter, year. Also, the lastdate function only aggregates records that have a transaction on the last date. I need to aggregate all closing balances for the last available record for each account. I tried this, but the OLAP query runs out of memory:

:=SUMX( ALL( vwCPAccountRevenueRecognition[CPAccountID] ),
CALCULATE( SUM( vwCPAccountRevenueRecognition[DeferredIncomeCP] ),
LASTNONBLANK( DATESBETWEEN( vwCPAccountRevenueRecognition[RecognitionDate],
BLANK(),
LASTDATE( vwCPAccountRevenueRecognition[RecognitionDate] ) ),
CALCULATE( COUNT( vwCPAccountRevenueRecognition[DeferredIncomeCP] ) ) ) ) )

]]>
Comment on Ask your questions here by Kasper de Jonge http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212131 Thu, 23 Apr 2015 22:12:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212131 Have you checked out the closingbalance function? https://support.office.com/en-us/article/CLOSINGBALANCEMONTH-Function-DAX-26A549C1-835A-48F7-87EC-38AF876F0E21

or Robs post: http://www.powerpivotpro.com/2011/12/cash-flow-statement-in-powerpivot/

]]>
Comment on Ask your questions here by Ben http://www.powerpivotblog.nl/ask-you-questions-here/#comment-212121 Thu, 23 Apr 2015 21:37:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-212121 Hello Thomas/Kasper,

Any thoughts on how to calculate the closing balance for a column where each item, aka account, has a different last day? For example, I’m trying to aggregate the last value of the deferredincomecp column for all accounts for the month of February even though each account has a different last day. In other words, not all accounts on the attached image have a transaction on 3/31 so using that day for the closing balance would exclude accounts that had their last transaction earlier in the month.
Thanks,
Ben

]]>
Comment on New version of the Power BI designer now supports DAX by Power BI Designer Preview – April Update | MS Excel | Power Pivot | DAX http://www.powerpivotblog.nl/new-version-of-the-power-bi-designer-now-supports-dax/#comment-212101 Thu, 23 Apr 2015 05:46:32 +0000 http://www.powerpivotblog.nl/?p=7241#comment-212101 […] http://www.powerpivotblog.nl/new-version-of-the-power-bi-designer-now-supports-dax/ […]

]]>
Comment on Ask your questions here by J. gM http://www.powerpivotblog.nl/ask-you-questions-here/#comment-211801 Thu, 16 Apr 2015 17:35:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-211801 I do not know how I could have missed it, the blog owner states flat out where to find the file:
You can download the file here: http://1drv.ms/1miiVPG

The reference was given at:
http://www.powerpivotblog.nl/d

This one works. Excel can swallow it.

]]>
Comment on Ask your questions here by Tim Langford http://www.powerpivotblog.nl/ask-you-questions-here/#comment-211792 Thu, 16 Apr 2015 16:53:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-211792 Thanks Thomas, I’ve discovered the answer I’m happy to say – I had for example Sales Rep in 2 tables and bought it into the Pivot table from the wrong source. Once I had the right ‘version’ of data, it worked perfectly

]]>
Comment on Ask your questions here by Thomas http://www.powerpivotblog.nl/ask-you-questions-here/#comment-211791 Thu, 16 Apr 2015 16:40:00 +0000 http://business-inteligence.kdejonge.net/?page_id=2#comment-211791 Tim,
Sounds interesting and I think there is a good solution that can be worked through quickly.
Like you, I am a visitor to Kasper’s “Ask your questions here” web page, but I often come to the site to help and learn. What some visitors do want to share a file is to use a resource like dropbox or Excel online. I could be corrected, but I think the choices here on site are to post comments and attach an optional image. Some site visitors with small data sets (which is probably not the case here) have listed their data at the bottom of their comments.
If you would respond to this comment with a link to dropbox or Excel online that would be great. You could also email me (by replacing the following AT with an @):

tallanATprodigy.net

If emailed, I will respond to you with answers over this web page (or use a dropbox link also posted on this web page).

]]>