Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi
As an example, I have a table in the below format.
| Period | startingDate | endingDate |
| P1 | 01/01/2024 | 28/01/2024 |
| P2 | 29/01/2024 | 25/02/2024 |
| P3 | 26/02/2024 | 31/03/2024 |
I want to create a table that has every date allocated to a period. I have created a custom column as per the below:
Table.AddColumn(#"Removed Columns", "Custom", each List.Dates([startingDate], Number.From([endingDate]-[startingDate])+1, #duration(1,0,0,0)))
This gives the desired output but when trying to apply these changes it comes back with the following error.
OLE DB or ODBC error: [Expression.Error] The 'count' argument is out of range..
I can't work out why this is, does anyone else know?
Thanks in advance,
Ross
Solved! Go to Solution.
@RossBateman96 , try using below mentioned code
Table.AddColumn(#"Removed Columns", "Custom", each if Number.From([endingDate] - [startingDate]) >= 0 then List.Dates([startingDate], Number.From([endingDate] - [startingDate]) + 1, #duration(1,0,0,0)) else null)
Proud to be a Super User! |
|
@RossBateman96 , try using below mentioned code
Table.AddColumn(#"Removed Columns", "Custom", each if Number.From([endingDate] - [startingDate]) >= 0 then List.Dates([startingDate], Number.From([endingDate] - [startingDate]) + 1, #duration(1,0,0,0)) else null)
Proud to be a Super User! |
|
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 40 | |
| 35 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 38 | |
| 35 | |
| 23 |