Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm trying to create a measure that provides a count of contracts that are active at any time in a given month.
Right now each row of data is a single contract so I can just use countrows() for the counting but I'm trying to figure out the active part.
You can see below a simple version of the data I have along with the results I'm trying to put together. I also have a Primary Date Table which I link to the Contract Start Date. This table contains every date possible along with a year-month column for the year month portion of the matrix.
Any help would be appreciated.
| Contract Name | Start Date | End Date |
| Contract 1 | 10/1/2018 | 12/31/2018 |
| Contract 2 | 10/15/2018 | 1/15/2019 |
| Contract 3 | 10/31/2018 | 2/1/2019 |
| Contract 4 | 1/1/2019 | 1/30/2019 |
| Contract 5 | 1/28/2019 | 4/1/2019 |
Results:
| Oct-18 | Nov-18 | Dec-18 | Jan-19 | Feb-19 | Mar-19 | Apr-19 | |
| Active Contracts | 3 | 3 | 3 | 4 | 2 | 1 | 1 |
Solved! Go to Solution.
This works (at least it gets the same results as your expected results. Note I am in Australia so our date format is dd/mm/yyyy!
1. Get data (Contracts)
Create a pair of measures called Mindate and Maxdate on Contracts
3. Create a calendar table as follows;
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
This works (at least it gets the same results as your expected results. Note I am in Australia so our date format is dd/mm/yyyy!
1. Get data (Contracts)
Create a pair of measures called Mindate and Maxdate on Contracts
3. Create a calendar table as follows;
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |