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 August 31st. Request your voucher.
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.
userid | session_count | month_start |
A1 | 0 | Jan-20 |
A1 | 1 | Feb-20 |
A1 | 1 | Mar-20 |
A2 | 2 | Jan-20 |
A2 | 1 | Feb-20 |
A2 | 0 | Mar-20 |
Solved! Go to Solution.
Hi @tpoltorak ,
Try to create a new column:
Column = MINX(FILTER('Table',EARLIER('Table'[userid])='Table'[userid]&&'Table'[session_count]>0),'Table'[month_start])
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @tpoltorak ,
Try to create a new column:
Column = MINX(FILTER('Table',EARLIER('Table'[userid])='Table'[userid]&&'Table'[session_count]>0),'Table'[month_start])
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@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])
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.