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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

How to find if user performed only login or login + other actions

Hi, please guide me towards the right solution

 

I have an audit dataset like below:

 

AuditIDActionUserNameDateLoginWithFurtherActions
AuditID1LoginUser1Day1TRUE
AuditID2UpdateUser1Day1TRUE
AuditID3LoginUser1Day2FALSE
AuditID4LoginUser2Day3TRUE
AuditID5LoginUser2Day3TRUE
AuditID6UpdateUser2Day3TRUE
AuditID7LoginUser2Day4FALSE

 

I need to calculate the column "LoginWithFurtherActions" to find if a user only logged-in within a day or logged-in and updated some records.

Example:

1) If User1 performed action "Login" and action "Update" within Day1 then "LoginWithFurtherActions" = TRUE;

2) If User2 performed only action "Login" without action "Update" within Day4 then "LoginWithFurtherActions" = FALSE.

 

Many thanks for the help:)

Oleh

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to my understand, you want to set True() when the user in the same day Login and Update, set False() when only Login , right?

 

You could use the following formula to creata a measure:

Measure =
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[UserName] = MAX ( 'Table'[UserName] )
                && 'Table'[Date] = MAX ( 'Table'[Date] )
                && 'Table'[Action] = "Update"
        )
    )
RETURN
    IF ( MAX ( 'Table'[Date] ) = _date, TRUE (), FALSE () )

The final output is shown below:

12.28.1.1.PNG

 

Please take a look at the pbix file here.

 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

According to my understand, you want to set True() when the user in the same day Login and Update, set False() when only Login , right?

 

You could use the following formula to creata a measure:

Measure =
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[UserName] = MAX ( 'Table'[UserName] )
                && 'Table'[Date] = MAX ( 'Table'[Date] )
                && 'Table'[Action] = "Update"
        )
    )
RETURN
    IF ( MAX ( 'Table'[Date] ) = _date, TRUE (), FALSE () )

The final output is shown below:

12.28.1.1.PNG

 

Please take a look at the pbix file here.

 

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

Anonymous
Not applicable

Thanks! It works

 

littlemojopuppy
Community Champion
Community Champion

I would suggest NOT using a calculated column for this...measures are almost always preferable to calculated columns.

Here's code for a measure...

Users With Further Actions:=
	VAR	UsersLoggingIn = 
		CALCULATETABLE(
			VALUES(ActivityLog[UserName]),
			ActivityLog[Action] = "Login"
		)
	VAR	UsersDoingMore = 
		CALCULATETABLE(
			VALUES(ActivityLog[UserName]),
			ActivityLog[Action] <> "Login"
		)
	RETURN
	
	IF(
		ISEMPTY(UsersDoingMore),
		FALSE(),
		TRUE()
	)

 

littlemojopuppy_0-1608740836655.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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