cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
srutt
Regular Visitor

Power Query Table.ToList format not converting to date

I'm trying to convert a table of dates to a list (using Table.ToList), but I get an error that states it cannot convert the dates to a text.  How can I convert the table and keep the date format?

 

 

1 ACCEPTED SOLUTION
pqian
Microsoft
Microsoft

@srutt Why do you need the list of dates?

 

In any case, you can simply right click the table column's header and select "Drill Into", that should give you the column as a list. FYI, drilling into table columns yields a list, drilling into table rows yields a record.

View solution in original post

3 REPLIES 3
pqian
Microsoft
Microsoft

@srutt Why do you need the list of dates?

 

In any case, you can simply right click the table column's header and select "Drill Into", that should give you the column as a list. FYI, drilling into table columns yields a list, drilling into table rows yields a record.

srutt
Regular Visitor

Thanks, I figured it something easy that I was missing. 

 

On your question, I needed the list to create a custom function that works like NetworkDays but also excludes certain holidays. 

srutt
Regular Visitor

let
    Source = Sql.Database("xxx", "db"),
    dbo_tblHolidaySchedule = Source{[Schema="dbo",Item="tblHolidaySchedule"]}[Data],
    ChangedType = Table.TransformColumnTypes(dbo_tblHolidaySchedule,{{"HolidayDate", type date}}),
    RemovedOtherColumns = Table.SelectColumns(ChangedType,{"HolidayDate"})
in
    Table.ToList(RemovedOtherColumns)

Here's the code.

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors