Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I have requirement where i need to bring in previous month project information in current month if not availble along with other values. I'm doing this because i want YTD data in months. But when i checked YTD data value was not matching because projects which got closed was not having data in current month and hence YTD number was not matching with actual YTD numbers. In short actual YTD let's say when I select Jan + Feb if i get 100, then with new measure which i have created i should get this 100 when i select Feb only. For example
Date | Year | Sector | Project | Activity Currency | Gross Revenue | Direct Expenses | Staff Costs | OHonSubConsultant |
01-01-19 0:00 | 2019 | IID | P1 | INR | 83.22 |
Project P1 got closed in Jan month and there is no entry in Feb Month so i would like to basically generate or copy Jan month row as is for Feb and subsequent months. So that my YTD number will match. Do let me know if you need more information or in case of any queries.
Meanwhile i tried with
The generic answer for wanting to "copy the previous row" in DAX is to do it BEFORE you load the data. Here's the best explanation I've found about it:
Alternatively, and arguably a better approach, you may use Power Query before your data hits the DAX engine. Power Query bypasses the issue with DAX (discussed in the next two paragraphs) in multiple ways - the most elegant (although advanced - there's simpler methods) would List.Accumulate().
However, and every other post missed this, the answer to "Is it possible to have a Calculated DAX column that uses the previous rows calculated value as an input? " is NO. This is a recursive question. DAX cannot do recursion.
The reason why is simple: when the engine is compiling your calculated columns the smallest atomic unit in the DAX engine is a column - not a cell, like Excel. DAX cannot calculate the first cell in a column, then the next, then the next etc because it has no concept of a cell. It calculates the entire column at once because there is nothing smaller. This is a very important concept to understand when first learning DAX.
https://www.reddit.com/r/PowerBI/comments/9m0b49/dax_refer_to_previous_row_of_same_column/
Help when you know. Ask when you don't!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |