Forum Discussion
Snapshots and Cumulative in one table (Calculated Columns)
Hi everyone!
Update : The file is attached ,File is here
I have a bit of a booger here that has been hanging me up for several days. I know its been done before but after multiple searches on youtube and forums I cant find my use case exactly. I am in the midst of trying to use power query to fix my issue as DAX, from my approach did not work. Cumulative formulas are everywhere and they are great for curves but I need them to be independent columns, not calculations. The one I am currently using for a curve but cannot lay it in a table is something like this example,
Dynamically Running Accumulation =
CALCULATE (
[Accumulation by YM],
FILTER (
'Sample Table',
'Sample Table'[YM] >= MIN ( 'Calendar'[Date] )
&& 'Sample Table'[YM] <= MAX ( 'Calendar'[Date] )
)
)
So essentially I have a monthly snapshot that comes in. SS1, SS2, SS3 and so on.
I need a monthly expense as shown below and then I need a cumulative. Where I am getting tripped up though is, I need the cumulative to be a row.
Each project per month as a cost to it, for a snapshot. My data is structured below in that format with the exception of the cumulative since that is what I am trying to get to.
I feel like I need to do this in power query and pivot but even at that point I am getting stuck without making multiple queries and finally combining them at the end, making my powerbi report not so efficient plus major maintenance as this happens every month.
Any assistance would be greatly appreciated!!!
3 Replies
- bolfri
Solution Sage
Can you provide sample data to work with?
- gamingguy81New Member
I added the link to it on the post, on the very top.
- bolfri
Solution Sage
Hi,
this this one. 🙂
Cumulative Sum = var last_date = LASTDATE(dim_calendar[Date]) return CALCULATE( SUM(fact_forecast[Total Amount]), FILTER(ALLSELECTED(dim_calendar),dim_calendar[Date]<=last_date) )