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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors