Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Direct Query unnecessary CAST

We are using a guid column in every table for RLS. In some cases PowerBi does use the column directly as string but in some cases the column gets casted to VARCHAR(64). The datatype in sql server is always the same nchar(36).

 

How can I force PowerBi to use the string as-is and not to cast the value?

1 REPLY 1
avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi @Anonymous ,

 

Sorry, I am not using DQ often, but I thought that Power BI only has type text type and if any text-like would automatically type-defined, it would be converted to this type. There is no string or VARCHAR, or this is what you see when the SQL code runs server-side? From memory, you should be able to define the cast type in the SQL request itself? Something like SELECT CAST(25.65 AS varchar). Did you try this?

 

Kind regards,

JB

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)