Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Help! Measure to count the number of Unique Logins.

ef1.PNG

 

Hello Guys,

THis is how my data look like,

I need to count the number of "In" for a particular person for a relative number of days.

 

A person can be in and out for multiple number of times. Ideally, I'm looking to count a In for a particular User_Id, since there could be multiple people with same names.

 

Looking forward to hearing from you all.

Thanks,

Anand

 

 

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

At first, you need to add an index column in the query editor.

Then add an new column "rank".

RANK=
RANKX (
    FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
    'Table'[Index],
    ,
    ASC,
    DENSE
)

Now, you could use COUNTROWS() function.

Measure =
COUNTROWS(FILTER('Table','Table'[SCAN_TYPE]="IN"&&'Table'[RANK] = 1))

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

5 REPLIES 5
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

At first, you need to add an index column in the query editor.

Then add an new column "rank".

RANK=
RANKX (
    FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
    'Table'[Index],
    ,
    ASC,
    DENSE
)

Now, you could use COUNTROWS() function.

Measure =
COUNTROWS(FILTER('Table','Table'[SCAN_TYPE]="IN"&&'Table'[RANK] = 1))

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

I used this.
 
measure= Calculate(distinctcount('Table'[User_ID]),FILTER('Table','Table'[Scan type]="In"))
Anonymous
Not applicable

Thanks for your reply.

Yeah I figured that out yesterday. I used count rowsas well but with a different approach.

 

I will mark this as a solution.

 

Thanks again!

Shuwyyyy
Advocate I
Advocate I

Hi Anand,

 

As per my analysis,You can create a unique field by combining user_id and Scan type afterwords you can calculate with the number of in count per user.

 

Hope this willl help you out.

Regards,

Pratima

Anonymous
Not applicable

Thank you for your reply.

But I will need to use a slicer with dates. So creating a unique field would not work with filter.

I would just need a measure to count the first In for unique user_id with date filters.

 

 

Thanks,

Anand

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.