Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous
Not applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Direct Query unnecessary CAST
01-28-2020
06:54 AM
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

Anonymous
Not applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2020
12:57 PM

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

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
01-28-2025 05:09 PM | |||
02-14-2019 08:36 AM | |||
08-23-2024 12:23 AM | |||
07-30-2024 06:39 PM | |||
01-10-2025 11:27 AM |
Top Solution Authors (Last Month)
User | Count |
---|---|
33 | |
18 | |
14 | |
11 | |
10 |