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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

@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

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.