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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
TEACHY888
Regular Visitor

Dynamic Date Range selection of two Date Column by 1 Slicer

Hi Gurus, really stucked here and need some help. 

OpportunityOldValue_NewValue table got two Date Column Changed_Date and OpportunityCreatedDate .
I need to create a dateSlicer / daterange on ChangedDate column which should also filter CreatedColumn and show the amount
So far I have tried this but its not working :
 
NewCalculation1 =
VAR StartDate = CALCULATE(MIN(OpportunityOldValue_NewValue[Changed_Date].[Date]), ALL(OpportunityOldValue_NewValue[OpportunityCreatedDate]))
VAR EndDate = CALCULATE(MAX(OpportunityOldValue_NewValue[Changed_Date].[Date]), ALL(OpportunityOldValue_NewValue[OpportunityCreatedDate]))
VAR LatestChangedDateTime = CALCULATE(MAX(OpportunityOldValue_NewValue[Changed_Date]), ALL(OpportunityOldValue_NewValue))

RETURN
IF(ISBLANK(CALCULATE(
    SELECTEDVALUE(OpportunityOldValue_NewValue[Amount]),
    FILTER(
        OpportunityOldValue_NewValue,
        OpportunityOldValue_NewValue[Changed_Date] = LatestChangedDateTime &&
        OpportunityOldValue_NewValue[Changed_Date] >= StartDate &&
        OpportunityOldValue_NewValue[Changed_Date] <= EndDate &&
        OpportunityOldValue_NewValue[OpportunityCreatedDate] >= StartDate &&
        OpportunityOldValue_NewValue[OpportunityCreatedDate] <= EndDate
    )
)), 0,
CALCULATE(
    SELECTEDVALUE(OpportunityOldValue_NewValue[Amount]),
    FILTER(
        OpportunityOldValue_NewValue,
        OpportunityOldValue_NewValue[Changed_Date] = LatestChangedDateTime &&
        OpportunityOldValue_NewValue[Changed_Date] >= StartDate &&
        OpportunityOldValue_NewValue[Changed_Date] <= EndDate &&
        OpportunityOldValue_NewValue[OpportunityCreatedDate] >= StartDate &&
        OpportunityOldValue_NewValue[OpportunityCreatedDate] <= EndDate
    )
))
 
Really need some helpm here and any input would be appriciated , thanks
1 REPLY 1
lbendlin
Super User
Super User

create an active relationship between the date on your calendar table and the create date. Create an inactive relationship between the calendar date and the change date.  use USERELATIONSHIP in your measures to toggle between the joins.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors