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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Function not working properly when dates are used

 

 

 

(table_to_find as table,column_to_search as text,value_to_find as any, column_were_to_get_the_value as text) =>
let
    valid_row = Table.SingleRow(Table.SelectRows(table_to_find, each Table.Column(_,column_to_search)=value_to_find)),
    return = Record.Field(valid_row, column_were_to_get_the_value)
in
    return

 

 

 

Ive got this function, It searches a value on a table column and returns the value for another column on the same row. For some reason, It doesn´t work if the value specified Its a date. The column to search from Its supposed to be a unique index for the function to work properly

3 REPLIES 3
AntrikshSharma
Super User
Super User

@Anonymous Table.Column returns a list of values, are you supplying a list in the value_to_find parameter? If not then you are comparing list against scalar.

Anonymous
Not applicable

It returns a list, but its working inside an each context, wouldn´t that keep a single value from the list?

@AnonymousYup, sorry my bad, I misunderstood the code, if it works for everthing else then you need to supply the date as a date type, how are you doing that right now?

= FxGetValue ( Dates, "Date", #date(2007, 01, 01), "Date")

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.