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 dateJoin 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 everyone,
Good afternoon! I would like to ask how to get the date difference of the start and end date in one column (the same column).
I have a different status for each track ID, but I need to get the date difference per status. Is it possible to calculate within same column? (Note: S - start date, E - end date)
Solved! Go to Solution.
Hi, If you want to add a new column, I would try
StartToEnd =
VAR startdate = CALCULATE(MIN(Table[Signoff Date]),FILTER(Table, Table[Change Number] = EARLIER(Table[Change Number]) && Table[Status] = EARLIER(Table[Status])))
VAR enddate = CALCULATE(MAX(Table[Signoff Date]),FILTER(Table, Table[Change Number] = EARLIER(Table[Change Number]) && Table[Status] = EARLIER(Table[Status])))
RETURN DATEDIFF(startdate, enddate, DAY)
That should give you a duration for each combination of Change Number and Status
Hi, If you want to add a new column, I would try
StartToEnd =
VAR startdate = CALCULATE(MIN(Table[Signoff Date]),FILTER(Table, Table[Change Number] = EARLIER(Table[Change Number]) && Table[Status] = EARLIER(Table[Status])))
VAR enddate = CALCULATE(MAX(Table[Signoff Date]),FILTER(Table, Table[Change Number] = EARLIER(Table[Change Number]) && Table[Status] = EARLIER(Table[Status])))
RETURN DATEDIFF(startdate, enddate, DAY)
That should give you a duration for each combination of Change Number and Status
Hi! Thanks a lot for this! It worked perfectly. To add, could you also help me how can I remove weekends in the calculation? Appreciate your help.
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 |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |