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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BBurnett
Frequent Visitor

Performance Improvement Help Required

I have created a column and set the value dependant on the values within a number of other tables. The problem that I have is that in order to refresh the data in the table (or more soecifically the new column) it takes approx. 3 days for less than 5000 rows which seems somewhat excessive.  Below is the queries that I am using and I would love to get some suggestions on ways to do things better.

 

Tasks Table - (The table taking the time to refresh)

 

let
Source = OData.Feed("https://analytics.dev.azure.com/xxx/xxx/_odata/v3.0-preview/WorkItems?$select=WorkItemId,Title,State,StoryPoints,ParentWorkItemId,CompletedWork, AreaSK &$expand=Iteration($select=IterationPath,IterationName,IterationId) &$filter= WorkItemType eq 'Task'", null, [Implementation="2.0", OmitValues=ODataOmitValues.Nulls, ODataVersion=4]),
Custom1 = Table.ExpandRecordColumn(Source, "Iteration", {"IterationName", "IterationPath", "IterationId"}, {"Iteration.IterationName", "Iteration.IterationPath", "Iteration.IterationId"}),
Custom2 = if List.Count(List.FindText(Table.ColumnNames(Custom1), "WorkItemType" ))= 1 then Custom1 else Table.AddColumn(Custom1, "WorkItemType", each null),
Custom3 = Table.ReplaceValue(Custom2, each [WorkItemType], each if [WorkItemType] is null then LookUpItems([ParentWorkItemId], Bugs, "WorkItemId", "Bug") else [WorkItemType], Replacer.ReplaceValue, {"WorkItemType"}),
Custom4 = Table.ReplaceValue(Custom3, each [WorkItemType], each if [WorkItemType] is null then LookUpItems([ParentWorkItemId], LookUpSupportUserStories, "WorkItemId", "Support") else [WorkItemType], Replacer.ReplaceValue, {"WorkItemType"}),
Custom5 = Table.ReplaceValue(Custom4, each [WorkItemType], each if [WorkItemType] is null then LookUpItems([ParentWorkItemId], LookUpInfraUserStories, "WorkItemId", "Infrastructure") else [WorkItemType], Replacer.ReplaceValue, {"WorkItemType"}),
Custom6 = Table.ReplaceValue(Custom5, each [WorkItemType], each if [WorkItemType] is null then "Feature" else [WorkItemType], Replacer.ReplaceValue, {"WorkItemType"})
in
Custom6

 LookUpSupportUserStories (returns instantly)


let
featureList = Table.Column(LookUpSupportFeatures, "WorkItemId"),
userStories = Table.SelectRows(User_Stories, each List.Contains(featureList, [ParentWorkItemId]) )
in
userStories

 

LookUpSupportFeatures (returns instantly)

 

let
SupportFeatures = Table.SelectRows(Features, each Text.Contains([Title], "Support Request"))
in
SupportFeatures


The other lookup calls are similar the call for the bugs returns really quickly and isn't a problem the above calls are the problem. Relationships are as follows:

 

BBurnett_0-1617065538998.png

 

Any help that people can provide would be greatly appreciated. I am not overly skilled at Power Query and teaching myself from a Java background although haven't touched code in a loooong time!

 

 

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi  @BBurnett ,

The best practice for power query is mentioned in the official article, you can refer to the official article to optimize against your operation. Wish it is helpful for you!

Best practices when working with Power Query

 

 

 

 

Best Regards

Lucien

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.