Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I have a table with records that have a Start_Date and End_Date. They are connected to a master date table with an active connection to the Start_Date and an inactive connection to the End_Date.
I'm trying to create a matrix with yyyyMM in the columns and DISTINCTCOUNT of the records, where the record is counted in a given month if the Start_Date is less than or equal to the last day of a given month and the End_Date is greater than or equal to the first day of a given month.
I tried the following formula and got a blank result. Any help would be appreciated.
Solved! Go to Solution.
Try
_Functional Location Net =
VAR StartMonth =
MIN ( 'Date'[Date] )
VAR EndMonth =
MAX ( 'Date'[Date] )
VAR Result =
CALCULATE (
DISTINCTCOUNT ( 'Functional Location Master'[Functional Location] ),
'Functional Location Master'[Functional Startup Date] <= EndMonth,
'Functional Location Master'[Functional End Date Adjusted] >= StartMonth,
REMOVEFILTERS ( 'Date' )
)
RETURN
Result
This will return any records where the start date is before the end of the month, including in prior months. If you want to exclude prior months then you can add additional logic.
Try
_Functional Location Net =
VAR StartMonth =
MIN ( 'Date'[Date] )
VAR EndMonth =
MAX ( 'Date'[Date] )
VAR Result =
CALCULATE (
DISTINCTCOUNT ( 'Functional Location Master'[Functional Location] ),
'Functional Location Master'[Functional Startup Date] <= EndMonth,
'Functional Location Master'[Functional End Date Adjusted] >= StartMonth,
REMOVEFILTERS ( 'Date' )
)
RETURN
Result
This will return any records where the start date is before the end of the month, including in prior months. If you want to exclude prior months then you can add additional logic.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 23 | |
| 20 | |
| 17 | |
| 13 | |
| 13 |
| User | Count |
|---|---|
| 62 | |
| 41 | |
| 39 | |
| 38 | |
| 38 |