Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Date Slicer

Hi, 

 

How to add date slicer and get dynamic count of ID's?

 

tbl1

ID       timestamp                               

1           28/09/2020 11:14              

1           29/09/2020 11:14

1          30/09/2020 11:14 

1          1/10/2020 11:14

1           3/10/2020 11:14

1          5/10/2020 11:14

tab2:

 Used  DAX formulas to calculate min and max:

 

ID             min_date         Max_date           TotalLogin

1                28/09/2020     05/10/2020           6

     

Using date slicer if I select min_date =3/10/2020 and max_date = 5/10/2020 . My Total login should be 2.

The total logins are not count of dates but count of Id's.

Time can be ignored for now.

 

Thank you for helping with DAX.

  • Hello @md264092 , is Table 2 your expected result? If so, you can follow the steps below for the reference.

    First, add a new Date column to Table 1.

    Date = Tbl1[timestamp]. [Date]

    v-jingzhang_0-1602136372446.png

    Next, create the following measures:

    Max_date = MAX(Tbl1[Date])
    
    Min_date = MIN(Tbl1[Date])
    
    TotalLogin = COUNT(Tbl1[ID])

    Finally, place the Date column in a slicer, place IDs, and three previous measures in a table visual. Now, when you change the maximum and minimum date in the slicer, the data in the table will change accordingly.

    v-jingzhang_1-1602136372450.jpeg

    Best regards

    Community Support Team _ Jing Zhang

    If this post helps,please consider Accepting it as the solution to help other members find it.

3 Replies