Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have successfully created a ChatGPT function in Power Query Editor called getChatGPTResponse.
But, the Measure that I'm trying to use in the Power BI Desktop doesn't see my getChatGPTResponse function.
Below is the measure.
Why can Power BI Desktop not find the function?
ChatGPTResponse = VAR SelectedMessage = SELECTEDVALUE(UserInput[UserInput]) RETURN IF(ISBLANK(SelectedMessage), BLANK(), getChatGPTResponse(SelectedMessage))
Would you please provide specific steps on the following suggestion that you made?
...use the function in the Power Query editor to create a new column that stores the result of the function for each row of data.
Hi @jellis1971
DAX measures cannot directly call or recognize M functions created in the Power Query editor.
That's why Power BI Desktop can't find the function when trying to use it in a DAX measures.
You may consider the following actions:
Before loading the data into the model, use the function in the Power Query editor to create a new column that stores the result of the function for each row of data.
After you apply the function and add the new column containing the results, load the transformed data into Power BI Desktop.
Once the data contains the results of the function, you can create DAX measures that operate on this data as needed.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
20 | |
13 | |
12 |
User | Count |
---|---|
43 | |
31 | |
24 | |
23 | |
22 |