Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
stiani
Frequent Visitor

Transpose table with every period in between dates

So i have a table with rental objects. Each object has an ID. each row in the table shows new index regulations. So for the chosen ID i got 2 regulations. Rentobject table.JPGIn order to compare vs accounting i need to transpose this table into a monthly table for each object ID like this from "date start" to a set date. In this example desember.24.

 

Object IDYearMonthRent
....c9d2020035520
....c9d2020045520
....c9d2020055520
....c9d.........
....c9d2021035912
....c9d2021045912
....c9d.........
....c9d2022036000 
....c9d

2022

046000
....c9d2022056000
....c9d............
....c9d2024126000

 

And i wanna do this in power query in Power BI. 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @stiani ,

if you add a new column calling this custom function: Date.DatesBetween to retrieve dates between 2 dates in Power BI and Power Query – The BIccountant
you should achieve your goal without transposing. When you choose "Month" in the 3rd parameter, you can simply expand the result and will get one row per month. 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Community Champion
Community Champion

Hi @stiani ,

if you add a new column calling this custom function: Date.DatesBetween to retrieve dates between 2 dates in Power BI and Power Query – The BIccountant
you should achieve your goal without transposing. When you choose "Month" in the 3rd parameter, you can simply expand the result and will get one row per month. 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors