Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jhoyabel19
Helper I
Helper I

Help: what is the Dax code To use????

Hi Newbie here in Dax formula, 

 

what formula should i use if this is the outcome that i want to see ( expected Result, i want to get the oldest date). Thank you so much for the help

 

ProfileIdFinal Submission DateDistinctProfileDate expected Result
18747510/03/2023187475-3/10/2023 187475-3/10/2023
18747510/03/2023187475-3/10/2023 187475-3/10/2023
18747527/03/2023187475-3/27/2023 blank
18747527/03/2023187475-3/27/2023 blank
18747527/03/2023187475-3/27/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747501/04/2023187475-4/1/2023 blank
18747524/04/2023187475-4/24/2023 blank
18747524/04/2023187475-4/24/2023 blank
18747527/04/2023187475-4/27/2023 blank
18747527/04/2023187475-4/27/2023 blank
18747527/04/2023187475-4/27/2023 blank
18747528/03/2023187475-3/28/2023 blank
2 REPLIES 2
sevenhills
Super User
Super User

Exprected Column Result = 
IF ( 'Table'[ProfileId] = MIN('Table'[ProfileId]) 
          && 'Table'[Final Submission Date] = CALCULATE(Min('Table'[Final Submission Date]), Filter('Table', 'Table'[ProfileId] = MIN('Table'[ProfileId]) 
                                                                                                              && 'Table'[Final Submission Date] <= EARLIEST('Table'[Final Submission Date])))
   , 'Table'[DistinctProfileDate], blank()
)

Column DAX code

Greg_Deckler
Community Champion
Community Champion

@jhoyabel19 As a column:

expected Result column = 
  VAR __ProfileId = [ProfileId]
  VAR __MinDate = MINX(FILTER('Table', [ProfileId] = __ProfileId), [Final Submission Date])
  VAR __Result = MINX(FILTER('Table', [ProfileId] = __ProfileId && [Final Submission Date] = __MinDate), [DistinctProfileDate])
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.