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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MRUGLADIATOR
New Member

DAX HELP - Return Corresponding value for minimum date

Hi there!

 

I am somewhat new to DAX and I am running into an issue:

 

I am using the "Opportunities Table" from the Regional Sales Sample pbix file and I am trying to do the following:

 

MRUGLADIATOR_0-1721343209853.png

In the above table that I have created, for each Purchasing Process and Sales Stage, I wanted to know the earliest created date.

The DAX that I created for the "Earliest Created Date" was as follows:

Earliest Created Date = min(Opportunities[Opportunity Created On])
 
So what this returned me, was the earliest date that an Opportunity was created for each Sales Stage and Purchasing Process.
 
Now, I would like to have the corresponding "VALUE" for that "Earliest Created Date" & Sales Stage & Committee. In the above table, it is returning $10,131,326. However the correct value should have been $4,448. 
 
Can anyone help me write the DAX to return the correct value?
 
 
 
1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @MRUGLADIATOR,

Please try this DAX formula:

 

SUM Value EarliestDate = 
VAR _EarliestDate = [Earliest Created Date]
VAR _Table = 
FILTER(
    Opportunities,
    [Opportunity Created On] = _EarliestDate
)
VAR _Result = 
    SUMX(
        _Table,
        Opportunities[Value]
        )
RETURN
    _Result

 

The final output should be this:

 

_AAndrade_0-1721346214958.png
I'm attaching the pbix file with my solution.

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

1 REPLY 1
_AAndrade
Super User
Super User

Hi @MRUGLADIATOR,

Please try this DAX formula:

 

SUM Value EarliestDate = 
VAR _EarliestDate = [Earliest Created Date]
VAR _Table = 
FILTER(
    Opportunities,
    [Opportunity Created On] = _EarliestDate
)
VAR _Result = 
    SUMX(
        _Table,
        Opportunities[Value]
        )
RETURN
    _Result

 

The final output should be this:

 

_AAndrade_0-1721346214958.png
I'm attaching the pbix file with my solution.

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.