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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
oliversc
Frequent Visitor

Snowflake connector direct query not returning integer surrogate key only decimal/float

I am in the process of porting a large 100% imported (from postgres) PowerBI model to use Snowflake as the direct query source for some of the larger tables while continuing to import other dimension and aggregation tables.

In PowerBI, we have an external application that has generated integer surrogate keys that we've used to define relationships in PowerBI. 
However when I attempt to return these keys from Snowflake and preview the results in PBI Desktop's PowerQuery viewer, these fields appear as decimal datatypes, not integers.   I cannot use PowerQuery to convert the data type to integer and retain DirectQuery.

 

Our Snowflake data loading logic specifies integer in the CREATE TABLE statement, but Snowflake creates all numeric datatypes internally as Number(38) which direct query sees as decimal/floating point number which I suspect will not perform as well in PowerBI relationship definitions.


Am I misinterpreting how PowerBI is seeing the datatypes, or has anyone found a way to return integer datatypes from Snowflake via PowerBI direct query?

TIA,

Oliver

2 REPLIES 2
oliversc
Frequent Visitor

Hi Jayee,  I want to use Snowflake as a direct query data source and do not want to import the data. 
If I try to change the datatype to 'Whole Number' in PowerQuery, then I can only import (rather than direct query) the table which defeats the objective of having a smaller in-memory dataset.  Thanks for responding anyway. 
Best regards, Oliver

Jayee
Responsive Resident
Responsive Resident

Hi @oliversc 

 

I'm having the same problem.  It seems to be caused by the fact that Snowflake treats all integer values as number(38,0).  So, when this is imported into PBI, it is seen as a decimal type. 

 

As you are using Drirect query in PBI model view you can change the datatype to wholenumber for that column it will not impact much and in dataset it will treat as wholenumber itself.

 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors