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
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
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!

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.