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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
mwadhwani
Kudo Kingpin
Kudo Kingpin

Dates between two dates of another table

Hello Experts,

 

I have  two tables:
TableA (Starttime,EndTime)
TableB(EndTime,F_Value)

I need count of F_Value between StartTime and EndTime of TableA from TableB(EndTime)

 

Any help would be highly appreciated.

 

1 ACCEPTED SOLUTION

Hi @mwadhwani,

 

You can create a measure below: 

 

Measure = CALCULATE(COUNT('TableD'[OperatingValue]),FILTER(ALL('TableD'),'TableD'[OperatingValue]<=5 && TableD[ProcessTime] >=MAX('TableB'[StartTime]) && 'TableD'[ProcessTime]<=MAX(TableB[End Time])))

 

Then drag a table visual to the report, please Start Time, End Time and measure. You can download the attached pbix file to have a look. 

 

w1.PNG

 

Best Regards,
Qiuyn Yu

Community Support Team _ Qiuyun Yu
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
Ashish_Mathur
Super User
Super User

Hi,

 

Share a dataset and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello @Ashish_Mathur,

Please find the below dataset:

https://www.dropbox.com/s/qmh248ioh7uh1u9/Dataset.xlsx?dl=0

Dataset has 3 tabs TableB,TableD,OutputStructure.

 

 

Note: I achieved above output using SQL.Below is the sql for reference:

 

SELECT
COUNT(D.OperatingValue),
C.StartTime,
C.EndTime
FROM C,
D
WHERE D.OperatingValue <= 5
AND D.ProcessTime BETWEEN C.StartTime AND C.EndTime
GROUP BY C.StartTime,
C.EndTime

 

Thanks

 

 

Hi @mwadhwani,

 

You can create a measure below: 

 

Measure = CALCULATE(COUNT('TableD'[OperatingValue]),FILTER(ALL('TableD'),'TableD'[OperatingValue]<=5 && TableD[ProcessTime] >=MAX('TableB'[StartTime]) && 'TableD'[ProcessTime]<=MAX(TableB[End Time])))

 

Then drag a table visual to the report, please Start Time, End Time and measure. You can download the attached pbix file to have a look. 

 

w1.PNG

 

Best Regards,
Qiuyn Yu

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors