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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
amitpowerbi
New Member

How to find unique login for a user?

Hello all,

 

I have an issue getting the DAX formula for the below case.

I will explain the case with an example.

 

Datetimeuser idunique login
15 Dec7:30amit1
15 Dec7:32amit0
15 Dec7:40amit0
16 Dec9:30mohit1
16 Dec9:30mohit0
17 Dec7:40amit1

In the above table as you can see unique login for amit appear once in the starting later on it should appear as 0 for the same date. because User "amit" has already counted as 1 in the beginning and in second row it has counted 0 because user already login for the day.

and same you can see for the other user mohit when is login freshly on 16 Dec it appeared as 1 and later if he logins it has to come as 0.

if anyone can help me with the DAX formula for this it would be highly appreciated.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Hi @amitpowerbi 

Aha, then try to add a column with this:

UniqueLogin =
VAR _date = [Date]
VAR _user = [user id]
VAR _time =
MINX(
    FILTER(TableName, TableName[Date]=_date&&TableName[user id]=_user),
    TableName[time]
)
RETURN
IF([Time]=_time, 1, 0)
 
i tried and it worked like this:
FreemanZ_0-1671115408428.png

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

Hi @amitpowerbi 

try to create a measure with this:

LoginCount =

COUNTROWS(

    SUMMARIZE(

        TableName,

        TableName[Date],

        TableName[User]

    )

)

It is counting everything as one.

The repeated user for the day should count as a 0.

Anyway, I really thank you for your efforts.

Hi @amitpowerbi 

Aha, then try to add a column with this:

UniqueLogin =
VAR _date = [Date]
VAR _user = [user id]
VAR _time =
MINX(
    FILTER(TableName, TableName[Date]=_date&&TableName[user id]=_user),
    TableName[time]
)
RETURN
IF([Time]=_time, 1, 0)
 
i tried and it worked like this:
FreemanZ_0-1671115408428.png

Thank you so much.🙌

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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