Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX query for the below request

Hello community,   My data is something like above where a company belongs to different Sides based on the projects. Every project has a start date and project active date.   I want to calc...
  • AlexisOlson's avatar
    5 years ago

    Like this?

    To get this, I converted the date columns from text to date data type, created a new calculated table DimDate using CALENDARAUTO() and defined the following measure:

    CountSides =
    VAR SelectedDate = MAX ( DimDate[Date] )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( 'Sample'[Sides] ),
            'Sample'[EndDate] >= SelectedDate,
            'Sample'[StartDate] < SelectedDate
        )