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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Codemunchkin
Frequent Visitor

Unable to Convert list output to Date type

Hi, 

I have this:

Codemunchkin_0-1635815706529.png

 

The output needs to be in date type something that Date.StartOfYear() function would produce. I am unable to convert the data type to date type. Kindly help me out.

If I don't get date type from the above formula I get this error:

Codemunchkin_1-1635815976039.png

 

6 REPLIES 6
v-stephen-msft
Community Support
Community Support

Hi @Codemunchkin ,

 

Try Date.From or Date.FromText

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Syndicate_Admin
Administrator
Administrator

If the [Min Date] and [Max Date] columns in that table are Date type then the List.Min should return a Date (and it appears to do so in your pic).  Are they Date type?  If so, where is that date used and what is the error message for that table/query?

 

Pat

Hi Pat, 

The [Min Date] and [Max Date] are not columns they are the output of blank queries with this formula/m code:

[Min Date]

Codemunchkin_0-1635817296334.png

[Max Date]

Codemunchkin_1-1635817341351.png

 

These 2 queries are fed into this date table:

Codemunchkin_2-1635817406719.png

I convert this list to a table ofcourse and then once I exit the query to go to power bi desktop home page I get the error as I posted above.

 

The FilterOutUnnecessaryColumns[Min Date] is a column reference that returns a list, and List.Combine is putting those two lists together for List.Min.  Also, the pic with the error is only showing that there was an error with another query (not shown in pic), there may not be an issue with the Min Date and Max Date queries.  Which query actually had the error?

 

Pat

This is the error:

Codemunchkin_0-1635818067509.png

 

The date table has no errors:

Codemunchkin_1-1635818282072.png

 

Your Min and Max queries are sourced by the FilterOutUnnecessaryColumns query.  Does that have data?  To isolate the issue, you could hard code a list of dates to your min and max queries to see if it is the Date Table or FilterOut query that has the issue.

 {#date(2021,1,1), #date(2021,6,1)} // example list of dates

 

Pat

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.