Forum Discussion
Need help with Investment data calculations please!
- 1 year ago
Make sure you have a date table, marked as a date table, linked to your Posting Date column in a one-to-many single direction relationship.
You can then create measures like
Rolling Amount = VAR MaxDate = MAX ( 'Date'[Date] ) VAR Result = CALCULATE ( SUM ( 'Table'[Amount] ), 'Date'[Date] <= MaxDate, 'Table'[Category] = "Investments" ) RETURN ResultThe monthly difference is just the sum of the amount column
Monthly difference = CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Category] = "Investments" )and the cash movement would be
Cash Movement = [Monthly Difference] - CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Category] = "Movement on investment" ) - 1 year ago
Hi RichOB
Try this calc column
Rolling Invesments = IF ( 'Table'[Category] = "Investments", CALCULATE ( SUM ( 'Table'[Amount] ), FILTER ( 'Table', 'Table'[Category] = "Investments" && 'Table'[Posting_Date] <= EARLIER ( 'Table'[Posting_Date] ) ) ) )But you can actually do this with measures
What I dont get is for September, your cash movement is -435 when -500-65 = -565
Please see the attached sample pbix for the details.
Hi RichOB Could you follow these
Use the existing Rolling_Amount column from Table1 in your matrix.
Create a Monthly_Difference measure: CurrentMonth - PreviousMonth using the DATEADD function.
Create a Cash_Movement measure: Monthly_Difference - Movement on Investment.
Add a matrix visual with rows as Category, columns as months, and values as Rolling_Amount, Monthly_Difference, and Cash_Movement.
Hi Akash_Varuna I don't have an existing Rolling_Amount column from Table 1, that's what I need help with. Your other steps, 2,3 and 4 are doable after the Rolling_Amoutn column is created.
Thanks