Follow these practices in order to preserve data types in Power Query while transferring to the Power BI Data Model:
Team up with PM: Power Query explicitly defines all columns' data types instead of "Any." For this purpose, the "Data Type" dropdown for each column is used.
Check Data Types in the Model: Data loaded into power by BI from the Data Model can be verified on Model View or Fields Pane. Discrepancies must be manually corrected by selecting the field and opening the change to its data type on the ribbon.
Prevent Mixed Data Types: The input data must not contain different types in a single column, for example, text and numbers. A column with mixed types is differently interpreted in Power BI.
This can preserve the data type integrity and prevent any calculation or visualization errors.