Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
81 | |
52 | |
39 | |
35 |
User | Count |
---|---|
95 | |
79 | |
52 | |
49 | |
47 |