The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I have a table like this:
User_email | Login_Date | First_Active_Session | Logins_to_First_Active_Session |
emaila@test.com | 28/2/2022 | 28/2/2022 | 0 |
emaila@test.com | 18/3/2022 | 28/2/2022 | 0 |
emailb@test.com | 10/1/2022 | 15/2/2022 | 1 |
emailb@test.com | 15/2/2022 | 15/2/2022 | 1 |
emailb@test.com | 22/4/2022 | 15/2/2022 | 1 |
emailc@test.com | 1/5/2022 | 24/7/2022 | 3 |
emailc@test.com | 16/6/2022 | 24/7/2022 | 3 |
emailc@test.com | 28/6/2022 | 24/7/2022 | 3 |
emailc@test.com | 24/7/2022 | 24/7/2022 | 3 |
What I am trying to replicate is the number in the column called "Logins_to_First_Active_Session". Basically, I want to see how many logins occurred before the first active session per user email, excluding the first login (login 0).
How can I achieve this?
Solved! Go to Solution.
@Anonymous I believe you want something like:
Logins_to_First_Active_Session (column) =
VAR __First_Active = [First_Active_Session]
VAR __Email = [User_email]
RETURN
COUNTROWS(FILTER('Table', [User_email] = __Email && [Login_Date] < __First_Active))
@Anonymous I believe you want something like:
Logins_to_First_Active_Session (column) =
VAR __First_Active = [First_Active_Session]
VAR __Email = [User_email]
RETURN
COUNTROWS(FILTER('Table', [User_email] = __Email && [Login_Date] < __First_Active))
User | Count |
---|---|
65 | |
59 | |
55 | |
54 | |
32 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
45 |