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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Problem with Text.NewGUID() M Language

Hi!

we would like to assign a different GUID for each Row in a Query.

I've tried the function Text.NewGUID() but there are some strange behaviours.

 

I noticed that:

-  in Query Editor it's mandatory to put the column with the GUID as last after an index;

- if I merge or append the query with the ID with another one the system set the same GUID for every row;

- when the query it's applied the system set the same GUID for every row as in Report as in Data View.

 

Have someone experienced the same issue?

 

thanks,

have a nice day

 

Samuele

 

Status: New
Comments
v-jiascu-msft
Employee

Hi Samuele,

 

I have consulted the Product Team. There are numeric data type in the query that makes Text.NewGuid() returns same value. M is largely a functional language, which means that we expect the output of a function to be completely determined by its inputs. Unfortunately, there isn't a good workaround for now. Setting all the data type to Text sounds impossible. Sorry for the inconvenience.

 

Best Regards!

Dale

MarcelBeug
Community Champion

@v-jiascu-msft In the related topic on the Power BI Community forum, 2 workarounds are specified.

You mention that there are no good workarounds.
Is that a mistake or is something wrong with the specified workarounds?

v-jiascu-msft
Employee

Hi @MarcelBeug,

 

Thank you very much for such a excellent workaround. Maybe I missed the context from the very detailed explanations of PG. Your workaround and the way to handle this scenario are very helpful to me. Thanks again.

 

Anybody wants the workaround, please visit the Desktop forum here: https://community.powerbi.com/t5/Desktop/Problem-with-M-function-Text-NewGUID/m-p/297038#M131059

 

Best Regards!

Dale