Forum Discussion
pbi_qwerty
1 year agoNew Member
Desperately need help with DATEDIFF calculation
Hi, I have a table like this: Vacancy Vacancy No. Job Source Sourcing channel Vacancy Source closing date Date Vacancy Source Opening Date Date Vacancy Date created Date Vacancy D...
- 1 year ago
Hi pbi_qwerty ,
Please, add new calculated column using this DAX:
DaysCreatedToOpening = VAR ThisVacancy = 'PageUp_JobSourceData_Consolidated'[Vacancy Vacancy No.] VAR ThisJobSource = 'PageUp_JobSourceData_Consolidated'[Job Source Sourcing channel] VAR MinJobSourceForVacancy = CALCULATE( MIN( 'PageUp_JobSourceData_Consolidated'[Job Source Sourcing channel] ), ALLEXCEPT( 'PageUp_JobSourceData_Consolidated', 'PageUp_JobSourceData_Consolidated'[Vacancy Vacancy No.] ) ) RETURN IF( ThisJobSource = MinJobSourceForVacancy, DATEDIFF( 'PageUp_JobSourceData_Consolidated'[Vacancy Date created Date], 'PageUp_JobSourceData_Consolidated'[Vacancy Source Opening Date Date], DAY ), BLANK() )Your finally output will look like this:
Bibiano_Geraldo
Super User
1 year agoHi pbi_qwerty ,
Please, add new calculated column using this DAX:
DaysCreatedToOpening =
VAR ThisVacancy = 'PageUp_JobSourceData_Consolidated'[Vacancy Vacancy No.]
VAR ThisJobSource = 'PageUp_JobSourceData_Consolidated'[Job Source Sourcing channel]
VAR MinJobSourceForVacancy =
CALCULATE(
MIN( 'PageUp_JobSourceData_Consolidated'[Job Source Sourcing channel] ),
ALLEXCEPT(
'PageUp_JobSourceData_Consolidated',
'PageUp_JobSourceData_Consolidated'[Vacancy Vacancy No.]
)
)
RETURN
IF(
ThisJobSource = MinJobSourceForVacancy,
DATEDIFF(
'PageUp_JobSourceData_Consolidated'[Vacancy Date created Date],
'PageUp_JobSourceData_Consolidated'[Vacancy Source Opening Date Date],
DAY
),
BLANK()
)
Your finally output will look like this:
pbi_qwerty
1 year agoNew Member
Works great, thank you!