Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
trying to create a table in query similar to
the condition for this table is last 24 hours data but need it through power query not through dax as need to merge the data with different table
the requirement is a bit urgent if any one knows solution please reply i tried this in power query was getting an error
let
MaxStartTime = List.Max(Sheet1[Start_Time]),
StartTime = DateTimeZone.ToLocal(DateTime.From(DateTime.Date(MaxStartTime)) - #duration(23, 0, 0)),
EndTime = DateTimeZone.ToLocal(DateTime.From(DateTime.Date(MaxStartTime)) + #duration(23, 0, 0)),
GenerateSeries = List.Generate(
() => StartTime,
each _ <= EndTime,
each _ + #duration(0, 1, 0)
),
AddEndColumn = Table.FromList(GenerateSeries, Splitter.SplitByNothing(), {"Start Time"}),
AddEndColumnWithType = Table.AddColumn(AddEndColumn, "End Time", each [Start Time] + #duration(0, 1, 0))
in
AddEndColumnWithType
the errer was
Expression.Error: 3 arguments were passed to a function which expects 4.
Details:
Pattern=
Arguments=[List]
@Praneeth19
Please try this code, I modified the Generate func as well:
let
MaxStartTime = List.Max(Sheet1[Start_Time]),
StartTime = DateTimeZone.ToLocal(DateTime.From(DateTime.Date(MaxStartTime)) - #duration(23, 0, 0, 0)),
EndTime = DateTimeZone.ToLocal(DateTime.From(DateTime.Date(MaxStartTime)) + #duration(23, 0, 0, 0)),
GenerateSeries = List.Generate(
() => StartTime,
each _ <= EndTime,
each _ + #duration(0, 1, 0 , 0),
each _
),
AddEndColumn = Table.FromList(GenerateSeries, Splitter.SplitByNothing(), {"Start Time"}),
AddEndColumnWithType = Table.AddColumn(AddEndColumn, "End Time", each [Start Time] + #duration(0, 1, 0, 0))
in
AddEndColumnWithType
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
#duration needs 4 arguments #duration(day,hour,min,sec)
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 |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |