The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
firste question : quickly generate year, quarter, month, and day columns for each date in a power query table.
I have several dates in different tables (one hundred).
Second question: Is it possible for each table to create the 4 columns in a single step?
here there is no question of creating a date table. I just need to split each date into four columns.
Best regards
Hello, @hi_world
let
tbl = #table({"date_column"}, {{#date(2023, 03, 11)}, {#date(2023, 03, 23)}}),
new_columns =
Table.ExpandRecordColumn(
Table.TransformColumns(
tbl,
{"date_column",
each Record.AddField(Date.ToRecord(_), "Quarter", Date.QuarterOfYear(_))}
),
"date_column",
{"Year", "Quarter", "Month", "Day"}
)
in
new_columns
Hello @AlienSx ,
Thank you ! it works fine in import mode but it does not work in my use case because i'm using direct query mode.
Do you have any way to do that in DirectQuery ?
Best regards
@hi_world , nope, sorry. This is what MS site says:
If the Power Query Editor query is overly complex, an error occurs. To fix the error, you must either delete the problematic step in Power Query Editor, or switch to import mode. Multidimensional sources like SAP BW can't use the Power Query Editor.