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
tpoltorak
Helper I
Helper I

How to get the earliest date based on other columns

I have data in the following format and I am trying to identify when did every user have their earliest session, so that I can plot new starters for every month etc. What approach would you recommend please? DAX is a new thing for me. Thank you.

 

useridsession_countmonth_start
A10Jan-20
A11Feb-20
A11Mar-20
A22Jan-20
A21Feb-20
A20Mar-20
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @tpoltorak ,

 

Try to create a new column:

Column = MINX(FILTER('Table',EARLIER('Table'[userid])='Table'[userid]&&'Table'[session_count]>0),'Table'[month_start])

V-lianl-msft_0-1620108285195.png

 

 

Best Regards,
Liang
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
V-lianl-msft
Community Support
Community Support

Hi @tpoltorak ,

 

Try to create a new column:

Column = MINX(FILTER('Table',EARLIER('Table'[userid])='Table'[userid]&&'Table'[session_count]>0),'Table'[month_start])

V-lianl-msft_0-1620108285195.png

 

 

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

 

amitchandak
Super User
Super User

@tpoltorak , based on what I got. Assuming month_start is a date

 

A new column
minx(filter(Table, [userid] =earlier([userId])),[month_start])

 

A new measure

minx(filter(allselected(Table), [userid] =max([userId])),[month_start])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I would like it as a column, but your code populates the whole column with the same earliest date. I need it to be earliest per user.

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.