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.
Hi community,
have this one fo you:
I have this table called TP (travel periods)
Travel Start | Travel End | Index |
20/11/2018 | 12/12/2018 | TP1 |
10/01/2019 | 3/04/2019 | TP2 |
30/04/2019 | 26/06/2019 | TP3 |
what is needed is another table generated from the expansion of Travel Start and Travel End. Something looking like this:
Travel | Index |
Nov-18 | TP1 |
Dec-18 | TP1 |
Jan-19 | TP2 |
Feb-19 | TP2 |
Mar-19 | TP2 |
Apr-19 | TP2 |
this will be the conjuction between other tables to combine data together.
I tried with some variables butt came out to be crap.
Thank you for your help
Solved! Go to Solution.
Alright,
Then righ-click the original table and select Reference --> this creates another table that references the original TP table (i.e. if the TP table gets updated the updates also carry on to the expanded ), then apply the steps needed in the new table to get the desired result and maintain the origianl table.
An updated pbix: pbix
Br,
T
Hi @Anonymous,
Here's how to do it with Power Query.
In the Query Editor, calculate the days in between the end and start dates:
Then add another column that generates all the dates between start and end:
List.Dates([Start],[Subtraction],#duration(1,0,0,0))
After that, just expand the new column with the date list.
Here's a pbix with everything: pbix
Br,
T
Hi @Anonymous
thank you for this, however I need the expansion in a brand new table.
That's why I would suggest a formulated column/table.
But the TP table should remain as it is (it has another purpose)
Alright,
Then righ-click the original table and select Reference --> this creates another table that references the original TP table (i.e. if the TP table gets updated the updates also carry on to the expanded ), then apply the steps needed in the new table to get the desired result and maintain the origianl table.
An updated pbix: pbix
Br,
T
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |