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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Orman01
Regular Visitor

A measure that can be filtered by 2 date columns using 1 slicer

Hi Everyone! I have this requirement to create a slicer where a measure should be filtered by both start date and end date. (ex. We need to see the total tickets created and completed from Jan 1 to Jan 31 (Between Date Slicer)). Tried using USERELATIONSHIP but it can only filter one date column.

CREATED_COMPLETED = CALCULATE(DISTINCTCOUNT('RAW'[TICKETNUMBER]),USERELATIONSHIP('RAW'[DATE CREATED],'Date Table'[Date]),USERELATIONSHIP('RAW'[DATE COMPLETED],'Date Table'[Date]))

Thank you.

1 ACCEPTED SOLUTION
MasonMA
Impactful Individual
Impactful Individual

@Orman01 

 

Hi, in this case you would need to disconnect your Date table from RAW table and create one measure for filtering your report. 

You can refer to my testFile. I used this demo measure below and you can adjust it based on your real situation.

Tickets_CreatedAndCompleted = 
CALCULATE(
    DISTINCTCOUNT('Tickets'[TICKETNUMBER]),
    FILTER(
        'Tickets',
        'Tickets'[DATE CREATED] >= MIN('Date Table'[Date]) &&
        'Tickets'[DATE CREATED] <= MAX('Date Table'[Date]) &&
        'Tickets'[DATE COMPLETED] >= MIN('Date Table'[Date]) &&
        'Tickets'[DATE COMPLETED] <= MAX('Date Table'[Date])
    )
)

 Hope it helps:)

View solution in original post

4 REPLIES 4
Orman01
Regular Visitor

This works! Thanks a lot! 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1751943227562.png

 

 

Jihwan_Kim_0-1751943209279.png

 

created and completed: = 
VAR _t =
    FILTER (
        RAW,
        RAW[DATE COMPLETED] >= MIN ( 'Date Table'[Date] )
            && RAW[DATE CREATED] <= MAX ( 'Date Table'[Date] )
    )
RETURN
    COUNTROWS ( _t )

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you. I appreciate your response, however, I'm not sure why but some filters are not showing accurate numbers.

 

MasonMA
Impactful Individual
Impactful Individual

@Orman01 

 

Hi, in this case you would need to disconnect your Date table from RAW table and create one measure for filtering your report. 

You can refer to my testFile. I used this demo measure below and you can adjust it based on your real situation.

Tickets_CreatedAndCompleted = 
CALCULATE(
    DISTINCTCOUNT('Tickets'[TICKETNUMBER]),
    FILTER(
        'Tickets',
        'Tickets'[DATE CREATED] >= MIN('Date Table'[Date]) &&
        'Tickets'[DATE CREATED] <= MAX('Date Table'[Date]) &&
        'Tickets'[DATE COMPLETED] >= MIN('Date Table'[Date]) &&
        'Tickets'[DATE COMPLETED] <= MAX('Date Table'[Date])
    )
)

 Hope it helps:)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.