Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
The title of my question isn't clear but I didn't know what to call it.
I have a table of project, with 2 columns: ID and Title.
I have another table of reporting periods (months) from 2021 to today.
I want to create a table with a row for each project for each period.
So with 165 projects and 38 perios I expect 6270 rows.
Can you suggest the M Code to achieve this?
Solved! Go to Solution.
Code might be something like:
#"Added Custom" = Table.AddColumn(#"Previous Step", "Reporting Period", each #"Reporting Periods", type {text}),
#"Expanded Reporting Period" = Table.ExpandListColumn(#"Added Custom", "Reporting Period")
If your List of Reporting periods is in a table named Reporting Periods, you might need to change the reference to a table column type reference, eg #"Reporting Periods"[Column Name]
Hello @KervBruce,
you only need to add two lines of code:
let
Source = YourProjectTable,
ColumnMonth = Table.AddColumn(Source, "Month", each YourDatesTable),
OpenColumnMonth = Table.ExpandTableColumn(ColumnMonth, "Month", {"Month"}, {"Month"})
in
OpenColumnMonth
Best regards from Germany
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Code might be something like:
#"Added Custom" = Table.AddColumn(#"Previous Step", "Reporting Period", each #"Reporting Periods", type {text}),
#"Expanded Reporting Period" = Table.ExpandListColumn(#"Added Custom", "Reporting Period")
If your List of Reporting periods is in a table named Reporting Periods, you might need to change the reference to a table column type reference, eg #"Reporting Periods"[Column Name]
Hello @KervBruce,
you only need to add two lines of code:
let
Source = YourProjectTable,
ColumnMonth = Table.AddColumn(Source, "Month", each YourDatesTable),
OpenColumnMonth = Table.ExpandTableColumn(ColumnMonth, "Month", {"Month"}, {"Month"})
in
OpenColumnMonth
Best regards from Germany
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |