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! It's time to submit your entry. Live now!
I have a table of events with a start date and end date for each event. The start end and dates don't necessarily coincide with the start or end of months,quarters or years. I need to create a report with the event and the number of days, by year/qtr for the period of the event. I can use DateDiff to get the totals number of days or quarters between the start and end dates, but havent seen how to get the number of days, by qtr for the start to end date of the event.
Bob
Solved! Go to Solution.
You can get the number of days in a period by creating a new measure
Event days =
VAR StartDate =
SELECTEDVALUE ( 'Events'[Start Date] )
VAR EndDate =
SELECTEDVALUE ( 'Events'[End Date] )
VAR Result =
CALCULATE (
COUNTROWS ( 'Date' ),
KEEPFILTERS ( DATESBETWEEN ( 'Date'[Date], StartDate, EndDate ) )
)
RETURN
Result
Put that in a matrix with your events and any column from the date table.
You can get the number of days in a period by creating a new measure
Event days =
VAR StartDate =
SELECTEDVALUE ( 'Events'[Start Date] )
VAR EndDate =
SELECTEDVALUE ( 'Events'[End Date] )
VAR Result =
CALCULATE (
COUNTROWS ( 'Date' ),
KEEPFILTERS ( DATESBETWEEN ( 'Date'[Date], StartDate, EndDate ) )
)
RETURN
Result
Put that in a matrix with your events and any column from the date table.
That did it. Thanks
You use INTERSECT() for that.
If you like more help please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 16 | |
| 11 | |
| 9 | |
| 8 | |
| 7 |