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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Calculate count between two dates

Hi ,

 

I have three tables  fact table, sprint table.

 

Fac Table

 

Fact
IDBuildStatDateTriageStartDate
12110-11-202311-11-2023
12211-12-202312-11-2023
12312-12-202313-12-2023
12413-12-202314-12-2023
12514-12-202315-12-2023
12615-12-202316-12-2023
12716-12-202317-12-2023

 

Sprint 
Sprint StartEnd
Nov01-11-202330-11-2023
Dec01-12-202331-12-2023

 

Write dax to  Count id when Build Start date and  Triage Start date falls between Sprint Start date and End Date using calndar table .Expected Outcome will be:

 

SprintCount based on Build Start DateCount based on Triage Start Date
Nov12
Dec65
Total77
1 ACCEPTED SOLUTION
gmsamborn
Super User
Super User

Hi @Anonymous 

 

Would a measure like this help?

Build = 
VAR _SoM = SELECTEDVALUE( 'Sprint'[Start] )
VAR _EoM = SELECTEDVALUE( 'Sprint'[End] )
VAR _Count =
    COUNTROWS(
        FILTER(
            ALLSELECTED( 'FactTable'[BuildStatDate] ),
            'FactTable'[BuildStatDate] >= _SoM
                && 'FactTable'[BuildStatDate] <= _EoM
        )
    )
RETURN
    _Count

 

Counts for Build and Triage.pbix

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

4 REPLIES 4
gmsamborn
Super User
Super User

Hi @Anonymous 

 

Would a measure like this help?

Build = 
VAR _SoM = SELECTEDVALUE( 'Sprint'[Start] )
VAR _EoM = SELECTEDVALUE( 'Sprint'[End] )
VAR _Count =
    COUNTROWS(
        FILTER(
            ALLSELECTED( 'FactTable'[BuildStatDate] ),
            'FactTable'[BuildStatDate] >= _SoM
                && 'FactTable'[BuildStatDate] <= _EoM
        )
    )
RETURN
    _Count

 

Counts for Build and Triage.pbix

 



Proud to be a Super User!

daxformatter.com makes life EASIER!
Anonymous
Not applicable

Thanks , just wanted to check how we can implment this using calendar table.Because i need calendar table which filter both Build and Triage.

Hi,

For all practical purposes, the Sprint table is the Calendar table.  It should just have 3 columns - Date, Month name and Month number.  Sort the Month name by the Month number.  there shouldnot be a relationship between Calendar Table and the other 2 tables.


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

Understood. Thanks for the reply!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors