Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate if selected date is between two dates

Hi everyone!   I am struggling with a difficult problem. I have a fact table with 2 dates: Task Start Date and Task End Date. I have another dimension table (calendar table) with 2 inactive relatio...
  • tamerj1's avatar
    4 years ago

    Hi Anonymous 

    please use 

    =
    VAR MaxDate =
        MAX ( 'Calendar'[Date] )
    VAR MinDate =
        MIN ( 'Calendar'[Date] )
    RETURN
        SUMX (
            TableName,
            IF ( TableName[StartDate] <= MaxDate && TableName[EndDate] >= MinDate, 1 )
        )