Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have created a table in DAX as below:
Company Currency | Company Currency Amount | Item start | Item End |
EUR | 319282 | 1/1/2023 | 12/31/2023 |
… | … | … | … |
I want to expland each line of data into multiple lines based on the Item Start month and Item End month, so the first line of data should become 12 lines because the item start in 2023 Jan and ends in 2023 Dec. I would also like to restore the year month information in a new field called [Date Key] . How can I do this in DAX?
Company Currency | Company Currency Amount | Item start | Item End | Date Key |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 1/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 2/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 3/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 4/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 5/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 6/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 7/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 8/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 9/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 10/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 11/1/2023 |
EUR | 319282 | 1/1/2023 | 12/31/2023 | 12/1/2023 |
Solved! Go to Solution.
hi, @Jeanxyz
make a new table of date with start of every month
like below
then use below code
just adjust colum name and table name
result table =
GENERATE(
'Table',
FILTER(
'firstdate',
MONTH('firstdate'[date])>=MONTH('Table'[Item start])
&& MONTH('firstdate'[date])<=MONTH('Table'[Item End])
)
)
output like below
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
hi, @Jeanxyz
make a new table of date with start of every month
like below
then use below code
just adjust colum name and table name
result table =
GENERATE(
'Table',
FILTER(
'firstdate',
MONTH('firstdate'[date])>=MONTH('Table'[Item start])
&& MONTH('firstdate'[date])<=MONTH('Table'[Item End])
)
)
output like below
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |