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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JSher
Frequent Visitor

Filter a datasource(tableview) using date/time column off of a date, begintime and endtime

I have a drill through where I am on a page with a date,begintime and endtime measures in Table1.

 

I wish to show a filtered table view of Table2.  Table 2 has a date/time column.

 

How do I filter the table view of Table2 using measures from Table1.

 

I was looking at creating a filtered table but cannot figure out how to do times, only dates such as this:

FilteredTable = 
CALCULATETABLE(
    Table2,
    DATESBETWEEN ( Table2[Date], Table1[BeginDate], Table1[EndDate] )
)

Thanks

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @JSher ,

Since you have a drillthrough page, you can create a measure like this, put it in the table visual filter of table2 in the target page and set its value as 1:

A =
VAR tab =
    ADDCOLUMNS (
        'Table1',
        "BD",
            CONVERT ( [date] & " " & [BeginDate], DATETIME ),
        "ED",
            CONVERT ( [date] & " " & [EndDate], DATETIME )
    )
VAR bdt =
    MAXX ( tab, [BD] )
VAR edt =
    MAXX ( tab, [ED] )
RETURN
    IF (
        SELECTEDVALUE ( Table2[Date] ) >= bdt
            && SELECTEDVALUE ( Table2[Date] ) <= edt,
        1,
        0
    )

re.png

 

Best Regards,
Community Support Team _ Yingjie Li
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

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @JSher ,

Since you have a drillthrough page, you can create a measure like this, put it in the table visual filter of table2 in the target page and set its value as 1:

A =
VAR tab =
    ADDCOLUMNS (
        'Table1',
        "BD",
            CONVERT ( [date] & " " & [BeginDate], DATETIME ),
        "ED",
            CONVERT ( [date] & " " & [EndDate], DATETIME )
    )
VAR bdt =
    MAXX ( tab, [BD] )
VAR edt =
    MAXX ( tab, [ED] )
RETURN
    IF (
        SELECTEDVALUE ( Table2[Date] ) >= bdt
            && SELECTEDVALUE ( Table2[Date] ) <= edt,
        1,
        0
    )

re.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@JSher , I have something similar in the attached file, see if that can help

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This is what I am looking for but with Time.  Any idea how to incorperate 2 time variables and 1 date variable instead of 2 date variables?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.