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
bookhouseboy
Helper I
Helper I

Filter minutes in one table by start/stop times in another table

So this is probably very easy but I can't get it right. I have

  • one table with
    • one column of date/time by the minute,
    • and another column with number of transactions conducted in that minute
  • and another table with
    • one column with the names of certain events,
    • one column of date/time by the minute for the start of each event and
    • one column of date/time for the end of each event.

I just want to slice by event name and show the number of transactions only for minutes during the event selected.

I know this can't be hard but it just won't work. Can someone just point me in the right direction?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bookhouseboy 

You can refetr to the following sample

Table1

vxinruzhumsft_0-1700101893077.png

Table 2

vxinruzhumsft_1-1700101901225.png

Create a measure

Measure =
IF (
    ISFILTERED ( 'Table (2)'[Events] ),
    CALCULATE (
        SUM ( 'Table'[Number] ),
        FILTER (
            'Table',
            [Date] >= MAX ( 'Table (2)'[StartDate] )
                && 'Table'[Date] < MAX ( 'Table (2)'[End Date] )
        )
    ),
    CALCULATE ( SUM ( 'Table'[Number] ) )
)

 Output

vxinruzhumsft_2-1700102049446.png

 

vxinruzhumsft_3-1700102055725.png

Best Regards!

Yolo Zhu

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

2 REPLIES 2
bookhouseboy
Helper I
Helper I

This looks very promising. I'll have to make a few adjustments, but I can see a path to success now. Thank you!

Edit: It works! Thank you so much!

Anonymous
Not applicable

Hi @bookhouseboy 

You can refetr to the following sample

Table1

vxinruzhumsft_0-1700101893077.png

Table 2

vxinruzhumsft_1-1700101901225.png

Create a measure

Measure =
IF (
    ISFILTERED ( 'Table (2)'[Events] ),
    CALCULATE (
        SUM ( 'Table'[Number] ),
        FILTER (
            'Table',
            [Date] >= MAX ( 'Table (2)'[StartDate] )
                && 'Table'[Date] < MAX ( 'Table (2)'[End Date] )
        )
    ),
    CALCULATE ( SUM ( 'Table'[Number] ) )
)

 Output

vxinruzhumsft_2-1700102049446.png

 

vxinruzhumsft_3-1700102055725.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors