Forum Discussion

jelledaems's avatar
jelledaems
Frequent Visitor
4 years ago
Solved

Measure for consecutive days between two dates

Hi everybody,   My best wishes for the New Year!   I have a table that contains which people get what kind of support from the government: Person_Name Type_Support From_Date To_Date Joe...
  • smpa01's avatar
    4 years ago

    jelledaems  you can create a measure like this

    Measure =
    VAR _min =
        MIN ( 'Calendar'[Date] )
    VAR _max =
        MAX ( 'Calendar'[Date] )
    VAR _name =
        CALCULATE (
            MAX ( 'Table 1'[Person_Name] ),
            FILTER (
                'Table 1',
                'Table 1'[From_Date] <= _min
                    && 'Table 1'[To_Date] >= _max
                    && 'Table 1'[Type_Support] = "money"
            )
        )
    RETURN
        _name