Forum Discussion
Measure rounded to 0 decimals in DirectQuery
Hello,
I have a hybrid dataset connected to Snowflake via DirectQuery for Fact tables and import for dimension tables.
I've created a measure with SUM, but when i visualize it the decimals are rounding to 0, but the field from table is OK, it shows correctly decimals:
I need the decimal part on measure. Anyone have idea for right it?
Thanks in advance.
Regards,
- Anonymous1 year ago
UPDATE
I found the issue, is the new Snowflake connector 2.0 (https://learn.microsoft.com/en-us/power-query/connectors/snowflake#new-snowflake-connector-implementation-preview), i'd the connection the next way:
Source = Snowflake.Databases(database, Warehouse, [Implementation="2.0"])
I removed this part [Implementation="2.0"] to use the previous connector and then it works OK.
4 Replies
- AnonymousNot applicable
UPDATE
I found the issue, is the new Snowflake connector 2.0 (https://learn.microsoft.com/en-us/power-query/connectors/snowflake#new-snowflake-connector-implementation-preview), i'd the connection the next way:
Source = Snowflake.Databases(database, Warehouse, [Implementation="2.0"])
I removed this part [Implementation="2.0"] to use the previous connector and then it works OK.
- anilelmastasiSuper User
Hello Anonymous ,
You can create a new measure, like this= ROUND(SUM('FactTable'[Amount]), 2)
Or you can multiply with "1.0"
If this solved your issue, please mark it as the accepted solution. โ
- grazitti_sapnaSuper User
Hi Anonymous ,
Please use the below measure to achieve the desirable output.15.2 Valor Mercado Contravalorado =
ROUND(SUM(FACT_SCR_TIPO_CAMBIO[VALOR_MERCADO_KONTRAV]), 2)If the issue is still unresolved, check the column-level formatting for
VALOR_MERCADO_KONTRAVin your data model:-
Is it defined as
Fixed Decimal NumberorWhole Numberin Snowflake? -
Sometimes, DirectQuery doesn't recognize precision unless explicitly defined in the source.
๐ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
๐ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
๐ As a proud SuperUser and Microsoft Partner, weโre here to empower your data journey and the Power BI Community at large.
๐ Curious to explore more? [Discover here].
Letโs keep building smarter solutions together!
-
- AnonymousNot applicable
Thanks for your answers anilelmastasi and grazitti_sapna .
I try the round function on measure and multiply by 1.0, but the result is the same:
โIn Snowflake the field was defined as NUMBER(18,2), in PowerBI this column is difined as "Decimal", but in DirectQuery we can't change the type to "force it"
I analyse the query that PowerBI made for extract data from Snowflake, PowerBi send this query to Snowflake:
select SUM(cast("VALOR_MERCADO_KONTRAV" as INTEGER)) as "C1"
from
(
select "VALOR_MERCADO_KONTRAV"
from "FACT_SCR_TIPO_CAMBIO"
where cast("ID_FECHA" as DECIMAL) = CAST(20250131 as DECIMAL)
) as "ITBL"It converts the value to integer, but i don't know why it is doing this transformation. There are anyway to change it the way PowerBI mades this query?