Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |