Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

custom function changes datatype during run time

In power query I got a custom function which picks up the data, does left join and returns the records properly. The tables are linked using t1.c1 and t2.c2. the data type of both columns is Text. It is tested using sample data file used for the function. When that custom function is called from some else place (i read all files from a folder and call the function for each of the file)...the function works correctly except for the data with last digit as zero. e.g. "01.10", "01.20" in this last value is zero wherein for t1 the value is automatically converted as "01.1" and in T2 the value is retained as "01.01". Bu then records doesn't get linked as the data alues are different. Please note, in both the tables field's data type is text, but it seems still it trims out zero from t1.c1 but not t2.c2. Also within custom function it seems to be working fine, but when caller makes the call to the function it doesn't return matching records. Any idea what could be the issue?

Super User
Super User

Virtually impossible to tell without some data and the code for your function.


How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors