Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a new table based on date slicer

I have a table of data (TABLE_A), which I want to group by PersonID, based on a date slicer.   If I selected on the date slicer 01/02/2022 to 04/03/2022, then I want to have the TABLE_OUTCOME.   ...
  • v-henryk-mstf's avatar
    4 years ago

    Hi Anonymous ,

     

    I think you need to create a separate date table and then try the following formula:

    M_ = 
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] <= MAX ( 'Table 2'[Date] )
                && 'Table'[Date] >= MIN ( 'Table 2'[Date] )
                && 'Table'[PersonID] = MAX ( 'Table'[PersonID] )
        )
    )
    Table 2 = CALENDAR("2022-01-01","2022-04-03")


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.