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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
EnrichedUser
Helper III
Helper III

Reference Virtual Table - Value Between Two Times

Hi All, 

 

I have a virtual table

_Table = GENERATE(
SUMMARIZECOLUMNS(ActivitySheet[StartTime2], ActivitySheet[EndTime2], ActivitySheet[UserID], ActivitySheet[TransactionType], ActivitySheet[BranchID], ActivitySheet[ActivitySheetDate]),
        FILTER(VALUES(TimeTable[Time]),
            TimeTable[Time] >= ActivitySheet[StartTime2] && TimeTable[Time] <= ActivitySheet[EndTime2])
            )

 

The virtual table provides all the times between my StartTime2 and EndTime2 Values from my ActivitySheet table using the TimeTable. 

 

I need to create a messure using the virtual table to show when each person worked. 

 

Current:

EnrichedUser_0-1619624697328.png

 

Expected Output:

EnrichedUser_1-1619625211711.png

 

[ActivitySheet] - Sample

ActivitySheetDateUserIDStartTime2EndTime2TransactionType
4/26/2021IGARCIA7:53:00 AM8:41:00 AMORD.PICK
4/26/2021IGARCIA8:41:00 AM8:41:00 AMOTHER
4/26/2021IGARCIA8:41:00 AM8:42:00 AMOTHER
4/26/2021IGARCIA8:42:00 AM10:50:00 AMORD.PICK
4/26/2021IGARCIA10:50:00 AM1:18:00 PMWHSE.PICK
4/26/2021IGARCIA1:18:00 PM2:58:00 PMORD.PICK
4/26/2021IGARCIA2:58:00 PM3:01:00 PMORD.PICK

 

[TimeTable] - Sample

TimeTable is in a relationship with [ActivitySheet] on 'TimeTable'[Time] One to 'ActivitySheet'[Startime2]' Many

TimeHourMinuteHour NumberNext HourPeriodSortTimeKey10Min
8:04:00 AM8:00:00 AM489:00:00 AM28040
8:05:00 AM8:00:00 AM589:00:00 AM28050
8:06:00 AM8:00:00 AM689:00:00 AM28060
8:07:00 AM8:00:00 AM789:00:00 AM28070
8:08:00 AM8:00:00 AM889:00:00 AM28080
8:09:00 AM8:00:00 AM989:00:00 AM28090
8:10:00 AM8:00:00 AM1089:00:00 AM281010
8:11:00 AM8:00:00 AM1189:00:00 AM281110

 

 

 

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @EnrichedUser ,

 

This could be related to DAX performance, you can refer to this blog:https://maqsoftware.com/expertise/powerbi/dax-best-practices 

 

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

 

I think you always post the same thing and maybe it sometimes helps people, but your response doesnt relate to anything in this request and is too generic to be useful. 

 

and yes ive read that before. 

EnrichedUser
Helper III
Helper III

I was able to get it working using the below messure and making the table a calculated table instead of a virtual one

Working Segment = 
IF(COUNT('Test 2'[Time])>0,
1,
BLANK()
)

 

It nearly doubled the size of my file and is not a great long term solution. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors