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
Hi there.
I have a table of data I am pulling into PBI desktop that looks similar to the below:
| placement id | start date | end date |
| 1 | 01/01/2024 | 01/05/2024 |
| 2 | 01/01/2024 | 01/02/2024 |
| 3 | 01/02/2024 | 01/03/2024 |
| 4 | 01/02/2024 | 01/06/2024 |
| 5 | 01/02/2024 | 31/02/2024 |
| 6 | 01/01/2024 | 31/01/2024 |
| 7 | 01/03/2024 | 01/04/2024 |
| 8 | 01/03/2024 | 01/04/2024 |
| 9 | 01/03/2024 | 01/05/2024 |
| 10 | 01/04/2002 | 01/07/2024 |
My aim is to create a bar chart that shows when Active Placements against the last 3 months (i.e. A placement is active in that month if the start date is before the last day, and the end date is after the first day).
The issue is that placements will be active over multiple months so I want placements to be counted multiple times.
So far I have only been able to achieve this by adding 3 flag columns onto the table - marking as active or not active in month1, month2, month3 - and then creating a measure to calculate the total count.
| placement id | start date | end date | month1 | month2 | month3 |
| 1 | 01/01/2024 | 01/05/2024 | 1 | 1 | 1 |
| 2 | 01/01/2024 | 01/02/2024 | 1 | 1 | |
| 3 | 01/02/2024 | 01/03/2024 | 1 | 1 | |
| 4 | 01/02/2024 | 01/06/2024 | 1 | 1 | |
| 5 | 01/02/2024 | 31/02/2024 | 1 | ||
| 6 | 01/01/2024 | 31/01/2024 | 1 | ||
| 7 | 01/03/2024 | 01/04/2024 | 1 | ||
| 8 | 01/03/2024 | 01/04/2024 | 1 | ||
| 9 | 01/03/2024 | 01/05/2024 | 1 | ||
| 10 | 01/04/2002 | 01/07/2024 |
However, with the amount of other flags I need to consider, this will eventually require the addition of ~50 more columns. Which isn't neat or a great for processing time.
Is there a better way to do this? i.e. Can I split my data into a more refined model?
Thanks
Solved! Go to Solution.
Hi @Beth_H
You can use the linked pattern, it is very simple to use.
Note that the calendar has to be without a relationship with your fact table.
https://blog.finance-bi.com/power-bi-employee-count-by-month/
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hello @Beth_H,
Can you please try this approach:
1. Create a date table that covers the range of your data
let
StartDate = #date(2024, 1, 1),
EndDate = #date(2024, 12, 31),
DateList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1, 0, 0, 0)),
DateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),
TypeChanged = Table.TransformColumnTypes(DateTable,{{"Date", type date}})
in
TypeChanged
2. Then, expand each placement record into individual months during which the placement is active. (Ensure the relationship between your date table and your transformed placements table exists)
let
Source = YourPlacementTable,
AddMonths = Table.AddColumn(Source, "Months", each {Number.From([start date])..Number.From([end date])}),
ExpandMonths = Table.ExpandListColumn(AddMonths, "Months"),
AddYearMonth = Table.AddColumn(ExpandMonths, "YearMonth", each Date.ToText(Date.From([Months]), "yyyy-MM")),
RemoveUnnecessaryColumns = Table.RemoveColumns(AddYearMonth,{"Months", "start date", "end date"})
in
RemoveUnnecessaryColumns
3. Finally, create a measure to count the active placements for each month.
Active Placements =
CALCULATE(
COUNTROWS(YourTransformedPlacementTable),
FILTER(
YourTransformedPlacementTable,
YourTransformedPlacementTable[YearMonth] = FORMAT(MAX('DateTable'[Date]), "yyyy-MM")
)
)
Hope this helps!
Hi @Beth_H
You can use the linked pattern, it is very simple to use.
Note that the calendar has to be without a relationship with your fact table.
https://blog.finance-bi.com/power-bi-employee-count-by-month/
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
This works perfectly! Thank you.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 20 | |
| 18 |