Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
In the limited knowledge of Dax and power query functions, I still have not found a way to calculate the number of Campaigns running based on the start and end dates.
I have a table with sample data as follows:
| Campaign name | Start date | End date | |
| Campaign A | 2022-07-20 | 2022-11-17 | |
| Campaign B | 2022-08-16 | 2022-10-10 | |
| Campaign C | 2022-07-23 | 2022-11-17 | |
| Campaign D | 2022-08-10 | 2022-11-09 | |
| Campaign E | 2022-07-06 | 2022-09-07 | |
| Campaign F | 2022-08-06 | 2022-10-06 | |
| Campaign G | 2022-08-24 | 2022-09-18 | |
| Campaign H | 2022-07-14 | 2022-11-23 | |
| Campaign I | 2022-07-28 | 2022-11-20 | |
| Campaign J | 2022-08-04 | 2022-09-24 | |
| Campaign K | 2022-08-03 | 2022-11-18 | |
| Campaign L | 2022-07-30 | 2022-10-29 | |
| Campaign M | 2022-07-12 | 2022-09-17 | |
| Campaign N | 2022-08-08 | 2022-10-29 | |
| Campaign O | 2022-08-11 | 2022-09-27 | |
| Campaign P | 2022-08-08 | 2022-09-07 | |
| Campaign Q | 2022-07-18 | 2022-09-06 |
I want to calculate how many campaigns are happening on 11 Aug (for example) or similar any day I want to see how many campaigns are running. Can you suggest to me some solutions?
Solved! Go to Solution.
Hi, @give1ngaymai
Add a seperate calendar table and try this:
Count =
CALCULATE (
COUNT ( 'Table'[Campaign name] ),
FILTER (
ALL ( 'Table' ),
'Table'[Start date] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& 'Table'[End date] >= SELECTEDVALUE ( 'Calendar'[Date] )
)
)
Regards,
Ethan Fang
Hi, @give1ngaymai
Add a seperate calendar table and try this:
Count =
CALCULATE (
COUNT ( 'Table'[Campaign name] ),
FILTER (
ALL ( 'Table' ),
'Table'[Start date] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& 'Table'[End date] >= SELECTEDVALUE ( 'Calendar'[Date] )
)
)
Regards,
Ethan Fang
Hi,
You may download my PBI file from here.
Hope this helps.
You can use the technique I cover here. It's the same problem
https://exceleratorbi.com.au/how-many-employees-by-period/
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |