Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi.
So I have a table where every time a user logs into the app, the date (a timestamp) is recorded. A rough is example is this:
user_id | date_login |
1 | 9/1/2021 |
1 | 9/1/2021 |
1 | 9/2/2021 |
1 | 9/3/2021 |
2 | 9/3/2021 |
2 | 9/4/2021 |
1 | 9/4/2021 |
1 | 9/4/2021 |
3 | 9/4/2021 |
3 | 9/5/2021 |
3 | 9/6/2021 |
1 | 9/6/2021 |
2 | 9/6/2021 |
2 | 9/7/2021 |
2 | 9/7/2021 |
What I want to achieve is have a calculated column or measure called last_login that updates to the last date a user opened the app. So from my example, user_id 1 will have the last_login as 9/6/2021 and if he opens the app again the next day, it updates to that date.
How do I best do that exactly? My thoughts went to a measure because calculated columns aren't dynamic, or am I off here?
Much appreciated.
Solved! Go to Solution.
Hi @Anonymous ,
You could simply change the summarization type of date_login like this:
Or create measures:
Last login date1 = LASTDATE('Table'[date_login])
Last login date2 = MAXX(FILTER('Table','Table'[user_id]=MAX('Table'[user_id])),[date_login])
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.
Hi @Anonymous ,
You could simply change the summarization type of date_login like this:
Or create measures:
Last login date1 = LASTDATE('Table'[date_login])
Last login date2 = MAXX(FILTER('Table','Table'[user_id]=MAX('Table'[user_id])),[date_login])
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 just add a simple measure like this and in the visual, drop user column and the measure:
Last Date = MAX ( Table[DateTime] )
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
With a measure:
Last Login =
CALCULATE (
MAX ( MyTable[date_login] ),
ALLEXCEPT ( MyTable, MyTable[user_id] )
)
Regards
thanks!!! you really help me with this solution!
User | Count |
---|---|
85 | |
85 | |
67 | |
61 | |
56 |
User | Count |
---|---|
137 | |
110 | |
92 | |
84 | |
69 |