Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous
Not applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RELATEDTABLE + CALCULATE proper usage
12-20-2018
02:04 AM
I have two tables: Customer and Last login. (1 to many relationship)
Last login contains email addresses and their last login timestamp.
What I want is to create a calculated column in Customer table containing the most recent email address logged in for that customer.
I tried this but DAX does not like me and complains.
email = CALCULATE(RELATEDTABLE('Last login'[Email]));'Last login'[Timestamp] = Customer[Last login])
I've already spent 3hours googleing the solution but with no success.
Thanks for usefull advices.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
03:07 AM
@Anonymous
Try this
email = MAXX ( TOPN ( 1, RELATEDTABLE ( LastLogin ), [Time Stamp], DESC ), [Email] )
Regards
Zubair
Please try my custom visuals
5 REPLIES 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
02:19 AM
@Anonymous
Hi
Try this
email = VAR login = Customer[Last login] RETURN CALCULATE ( MAX ( 'Last login'[Email] ), 'Last login'[Timestamp] = login )
Regards
Zubair
Please try my custom visuals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
02:33 AM
Does not work only blanks in entire column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
02:48 AM
@Anonymous
By which field are the tables related?
Can you show a snapshot?
Regards
Zubair
Please try my custom visuals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
02:59 AM
Customer(ID)
Last login(Customer ID, Email, Timestamp)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
03:07 AM
@Anonymous
Try this
email = MAXX ( TOPN ( 1, RELATEDTABLE ( LastLogin ), [Time Stamp], DESC ), [Email] )
Regards
Zubair
Please try my custom visuals

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
06-05-2024 07:33 AM | |||
09-09-2024 04:50 AM | |||
07-18-2024 08:55 AM | |||
Anonymous
| 03-24-2023 07:12 AM | ||
02-28-2024 05:49 AM |
Featured Topics
Top Kudoed Authors (Last Month)
User | Count |
---|---|
121 | |
102 | |
88 | |
52 | |
46 |