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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.