Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I need help in creating a calculated column and don't know where to start.
So I have a dataset with Portfolio, Project, Reporting Date, Status as columns.
| Portfolio | Project | Reporting Date | Status | Time to Completed |
| Data | AAAA | 01 Apr 2022 | Started | 0 |
| Data | AAAA | 01 May 2022 | Completed | 1 |
| Data | AAAA | 01 June 2022 | On track | 0 |
| Data | AAAA | 01 July 2022 | Completed | 1 |
| Data | BBBB | 01 Apr 2022 | Completed | 0 |
| Data | BBBB | 01 May 2022 | Started | 0 |
| Data | BBBB | 01 June 2022 | Completed | 1 |
| Data | BBBB | 01 July 2022 | Completed | 0
|
| Divison | CCCC | 01 Apr 2022 | Completed | 0 |
| Divison | CCCC | 01 May 2022 | Started | 0 |
| Divison | CCCC | 01 June 2022 | Started | 0 |
| Divison | CCCC | 01 July 2022 | Completed | 2
|
What I want to calculate is the Time to Completed column (expected output in red), which is how long it took the status to turn to Completed. For example for the first project, it went from started to completed after 1 month in May and July, and for the second project it went Completed after 1 month in June, and similarly it took 2 months for the status to go to Green for the 3rd project.
For the second project, since the month after (July) was also "Completed", the Time to Completed remains at 0.
Also for the month in Apr in the same project the status is "Completed" but since that is the first entry that is recorded, there is no other Completed status to compare to hence why it is 0.
How would I do this?
@SMITHY10283 , Try meausre like , and find the file attcahed
Progress1 =
var _min = Maxx(filter(Projects, Projects[project] = earlier(Projects[Project]) && Projects[Status] = "Completed" && [Reporting Date] < earlier([Reporting Date])) , [Reporting Date])
var _min1 = if(ISBLANK(_min) , minx(filter(Projects, Projects[project] = earlier(Projects[Project]) && [Reporting Date] < earlier([Reporting Date])) , [Reporting Date]) , minx(filter(Projects, Projects[project] = earlier(Projects[Project]) && [Reporting Date] >_min && [Reporting Date] < earlier([Reporting Date])) , [Reporting Date]))
return
if(Projects[Status] = "Completed", DATEDIFF(_min1, [Reporting Date], MONTH),0
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.