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, I would really appreciate any assistance. I am trying to find the difference between the Start and End Date but in different rows and different columns. For example, in the attached data table, I would like to find the difference between the Start Date in second row and the End Date in the first row. Like how cumulative sum is executed. Like using Excel row and column indexes.
Solved! Go to Solution.
Hi mafesa sasol,
Please find the code :
Hi @Anonymous
Thank you very much. It works perfectly. However, in some cases, I get incorrect results. For example, in the attached snapshop. The results are in correct order for each user, however, the last row represents a new user where the difference between the Start and End Date is from June to April and gives me 8 which is weird. How do I filter these such that when the execution is a new user row, then a blank value is resulted or something at the beginning of a new user row.
How can I navigate around that. Actually, I want to filter the results by the unique id values. Is this error because of the extra additional columns in my table or what? also, I used the Filter ALLEXCEPT instead of ALL because I was getting incorrect negative values.
Hi @Anonymous Yes it is a calculated column. I have attached your code as:
Hi mafesa sasol,
Please find the code :
Hi, Can you help with excluding weekends (& holidays if possible) in the above solution you have posted?? Thank you!
Hi
I assume you make this calculation on a calculated column
var endddate=Table(End Date)
var finddate=calculate(min(Table(End Date)), Table(End Date)>enddate)
var datebeg=Table(Start Date)
return
datediff(datebeg,finddate,DAY)
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 |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |