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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nwyck
Frequent Visitor

Edit Query measure breaking problems

I used Edit Query to add a column to an existing table; now a bunch of measures are broken. No relationships were changed or invalidated, no existing fields were removed or reformatted. This has happened several times now...what gives?

5 REPLIES 5
v-frfei-msft
Community Support
Community Support

Hi @nwyck,

 

Based on my test, I  cannot reproduce your issue here. Could you please tell me how did you add the custom column in power query? Could you please share your M code to me. And what is the error message ?

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

We use Direct Query mode and I adjusted the script in Edit Queries for that table. I have done this many times in the past to test out new additions without issue. Ever since I updated to the latest Power BI a couple weeks ago, any time I try to add a column by updating the query any existing measure that used the RELATED() function seems to stop recognizing the connection between the adjusted table and a related table even though the existing relationship between them was unchanged by the addition. I have tried deleting the relationship and readding, making it single directional, bi-directional, etc...nothing seems to fix it. This addition does not in any way affect the existing data, so it makes no sense to me why this is happening. I am not at liberty to share out our data, so I understand that there may not be much you can do to assist; I just wondered if anyone had come across a similar issue.

 

nwyck
Frequent Visitor

Briefly: I have two tables 'Course Completions' and 'Courses' that have a many to one relationship on an 'ActivityId' field; I attempted to add a column to the Courses table to identify the Source [only one per course is possible], and now existing measures for Course Completions that attempt to use a RELATED() relationship to a field in the Courses

[ex: 

Course Completions - Passes non-Core = SUMX(FILTER('Course Completions',RELATED(Courses[CoreType])<>"Core"), [Passes]) ]
are telling me that the column 'Courses[CoreType]' either doesn't exist or doesn't have a relationship to any table available in the current context. This measure has existed for more than a year without issue, and I have in the past added columns to the Courses table without this issue; it only started happening since I updated my Power BI to the latest.
nwyck
Frequent Visitor

so, the problem was that the latest Power BI desktop, when you edit queries, defaults you to Import rather than maintaining the setting you had [in my case, Direct Query]. super simple, but a huge pain as you can undo Import back to Direct Query so I had to delete the whole table, readd it, reconstruct the relationships...not a fan of this change!

nwyck
Frequent Visitor

Just a note, I have done this same thing many times in the past without issue; only in the last week or so since downloading the latest Power BI have I had this issue with adding a new column to a table causing measures to stop working. Just wondering if anyone else has experienced similar...and hopefully have found/fixed the culprit.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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