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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Annemie19
Helper II
Helper II

Select Next Date in table after First Date in slider

Hi There, 

 

I have to create a measure that selects the first date in a column (measurementnextdate) that is after the the first date in a slider (AA MinDate) for each Covenant ID.

 

So if if the date in the slider is 30/09/2020 I want to only return the rows marked in red:

Capture3.JPG

 

This is the dax that I used:

 

AA Next MDate =
VAR FirstMeasurementDate = [AA MinDate]
 
VAR DatesGreaterThanValueDate =
FILTER (
SUMMARIZE (VwCovenant,VwCovenant[Measurementnextdate], VwCovenant[CovenantID]),
VwCovenant[Measurementnextdate] > FirstMeasurementDate
)
VAR NextImmediateDate =
MINX ( DatesGreaterThanValueDate, VwCovenant[Measurementnextdate] )
RETURN
NextImmediateDate

 

But it is not working. 

 

1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Your code and data don't really match, but the solution could be simple.  Once you do a "SUMMARIZE", if you refer to that table you should be able to just refer to the column itself:

 

AA Next MDate =
VAR FirstMeasurementDate = [AA MinDate]
VAR DatesGreaterThanValueDate =
    FILTER (
        SUMMARIZE (
            VwCovenant,
            VwCovenant[Measurementnextdate],
            VwCovenant[CovenantID]
        ),
        [Measurementnextdate] > FirstMeasurementDate  //Code change 1
    )
VAR NextImmediateDate =
    MINX ( DatesGreaterThanValueDate, [Measurementnextdate] )  //Code change 2
RETURN
    NextImmediateDate

 

If this doesn't work, can you share your pbix wit sensitive data removed? Otherwise please define [AA Min Date], make sure your data matches up with your code, and provide data in a format that can be easily copied.

 

Hope this helps

David

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.