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
Hundoa
Frequent Visitor

How to check if date falls between two dates, and if so, add values in a column

Hello all, 

 

I've spent some time trying to come up with some logic, however I can't seem to get anywhere with it.... hopefully one of you can help. 

 

Below is a sample table, which shows the date that a piece of work was "received" and the date that it was completed ("Closed"). Each 'Case ref' is given a value ('Bulk Count') of 1 in this example, however in the real dataset this could be any number. 

 

[CASES TABLE]

tb1.PNG

 

If the date in the below table is the => than the Received date and < Closed date, then I want to sum all the row values in the Bulk Count column, where that condition is met.

 

[DATE TABLE]

tb2a.PNG

 

So, the final table should look something like this;

 

tb2b.PNG

 

Sorry if that doesn't make any sense, my brain is a little fried. Please ask questions if you need any clarification. 

 

Thanks in advance. 

 

 

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Don't @Hundoa,

Try to create a measure like this:

Measure = CALCULATE(SUMX(FILTER(ALL('Table'),'Table'[Received]<=MAX('Table 2'[Date])&&'Table'[Closed]>=MAX('Table 2'[Date])),'Table'[Bulk count]))

V-lianl-msft_1-1607333065103.png

Best regards
Liang
If this post helps, then consider Accept it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@Hundoa , refer my HR blog on similar type of data.

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

video -https://www.youtube.com/watch?v=e6Y-l_JtCq4

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

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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