Forum Discussion
Completed Project - Missing Dates
- 2 years ago
You can add a random number to an existing date if status is completed and date is blank
IF ( 'table'[status] = "completed" && ISBLANK ( 'table'[end date] ), 'table'[end date] + RANDBETWEEN ( 7, 365 ), 'table'[end date] )
Random Completion Date = // Try this one
IF(ISBLANK([Completion Date]),
DATE(2017, 1, 1) + RANDBETWEEN(0, 365 * (2024 - 2017)), -- Random date between 2017 and 2024
DATE(
2017 + RANDBETWEEN(0, 7), -- Random year between 2017 and 2024
RANDBETWEEN(1, 12), -- Random month
RANDBETWEEN(1, 28) -- Random day
)
)
- chitti52 years ago
Helper I
mh2587 Hi, Thank you for the reply. There is another column in the table with "Status" of the project. The Completion date column has many blanks which also includes blanks for the Status "Active" projects and I want that to remain blank itself since they are currently active in system. So is there any DAX measure which can show the missing dates of the completed dates column for only "Completed" status and not for other status.
Thank you!
- chitti52 years ago
Helper I
danextian mh2587 I tried both your formulas and it worked. The only issue I have is all the random completed dates are showing even before it's start date. Please suggest if I should add anything to the existing formula to show the random completed dates after the start date.
- danextian2 years ago
Super User
You can add a random number to an existing date if status is completed and date is blank
IF ( 'table'[status] = "completed" && ISBLANK ( 'table'[end date] ), 'table'[end date] + RANDBETWEEN ( 7, 365 ), 'table'[end date] )