Forum Discussion

TheProv's avatar
TheProv
Frequent Visitor
3 years ago
Solved

Crossjoin with filters

Hi everyone. So, I have a table that defines subscriptions periods for users, that is like that: id user_id ends_at created_at 1 1   18/12/2022 2 2 22/12/2022 19/12/2022 3 ...
  • Jihwan_Kim's avatar
    3 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new table.

     

     

     

    New table = 
    SUMMARIZE (
        GENERATE (
            Data,
            FILTER (
                'Calendar',
                'Calendar'[Date] >= Data[created_at]
                    && 'Calendar'[Date]
                        <= IF ( Data[ends_at] <> BLANK (), Data[ends_at], TODAY () )
            )
        ),
        Data[user_id],
        'Calendar'[Date]
    )