Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX - Dates -Min and Max

Hi,

 

My question is around DAX formula. 

I am working on dates-login timestamp. I want to count how many times this person login to the system.

My table have ID, datetimestamp columns. 

id  datetimestamp

1    28/09/2020 11:14

1    28/09/2020 11:18

1    28/09/2020  22:23

2   16/09/2020  09:01

2    17/09/2020  15:59

 

step 1: find Min date and Max date of each person

step 2: then count 

Can you please help with DAX.

 

Many thanks

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    I can't attach pbix, hence adding images here.

    I hope this will help you to get the expected results.

     

    login Max datelogin min dateLoginsREsult

     

    Note:- Do mark this as accepted solution if it solve the problem.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I can't attach pbix, hence adding images here.

    I hope this will help you to get the expected results.

     

    login Max datelogin min dateLoginsREsult

     

    Note:- Do mark this as accepted solution if it solve the problem.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you Deepak.

    • Anonymous's avatar
      Anonymous
      Not applicable

      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

      After using the above DAX formulas my table now looks like this:

      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.