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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hi_world
Helper III
Helper III

Quickly generate year, quarter, month, and day columns

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

4 REPLIES 4
AlienSx
Super User
Super User

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.


 

Thank you @AlienSx 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.