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
Brianoreilly
Helper II
Helper II

Dynamic Date Slicer: Date Table and Source Table with Two Date Columns

 

Hi Community, 

 

I have a problem.

 

I have a number of measures that I need to build via a method of using a date slicer to sum the value between two dates. 

(See Screenshot below). 

 

I need Dax to push the Min Slicer Value (Date Table) and Max Slicer Value (Date Table) into measures in the Timecard Table. 

 

The timecard table works on the premise of two date fields. Start Date and End Date.

 

I need to create a measure that sums the values in the Total hours columns, where the Start Date >= Min Date on the Slicer & the End Date <= Max Date on the Slicer. 

 

 

I need to build many measure via a similar method. 

 

I am hoping to avoid the relationship method and userrelationship method if possible. 

 

Any help would be appreciated. 

 

Slicer Question.JPG

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Brianoreilly,

 

You may refer to the DAX below.

Measure =
SUMX (
    FILTER (
        Timecard,
        Timecard[Start Date] >= MIN ( 'Date'[Date] )
            && Timecard[End Date] <= MAX ( 'Date'[Date] )
    ),
    Timecard[Total Hours]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Brianoreilly,

 

You may refer to the DAX below.

Measure =
SUMX (
    FILTER (
        Timecard,
        Timecard[Start Date] >= MIN ( 'Date'[Date] )
            && Timecard[End Date] <= MAX ( 'Date'[Date] )
    ),
    Timecard[Total Hours]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.