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
ed_mcdill
Advocate II
Advocate II

Nested Sumx performance

Project Management Cost_Variable_Target =

 

VAR TargetPercentage =
ADDCOLUMNS (
Projects,
"Target_Percent", SWITCH (
TRUE (),
Projects[Project_Type] = "Type A", 0.125,
Projects[Project_Type] = "Type B", 0.11,
Projects[Project_Type] = "Type C", 0.12,
Projects[Project_Type] = "Type D", 0.06,
Projects[Project_Type] = "Type E", 0.107,
0
)
)

 

RETURN
SUMX (
TaskForecastMonths,
SUMX ( TargetPercentage, [Target_Percent] * [Project_Cost] )
)


I have Project dimension table (Projects) and a fact table (TaskForecastMonths) which stores how much the project costs by month. This is a tabular model owned by another team so I can't add a calculated column.

 

Based on the type of project I assign a different percentage (this is the bit I'd maybe use a calculated column if I owned the model), this percentage I then multiply against the project cost in the TaskForecastMonths fact table. This gives me a target cost for a team that I use for a KPI.

 

This works but it is very slow, (15-20 seconds to filter) and I'm assuming a nested sumx might be the issue. Does anyone have any experience with this? Also what's the best practice for submitting questions like this, how should I format and frame the question?

 

Thanks for all the help I've been receiving on this form.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @ed_mcdill,

 

Based on my research, the SUMX function might affect the execution performance, especially nested SUMX. You could refer to below blogs to optimizie your DAX formula:

 

Tune your PowerPivot DAX query, don’t use the entire table in a FILTER and replace SUMX if possible

Nested SUMX or DAX Query?

 

Best regards,
Yuliana Gu 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @ed_mcdill,

 

Based on my research, the SUMX function might affect the execution performance, especially nested SUMX. You could refer to below blogs to optimizie your DAX formula:

 

Tune your PowerPivot DAX query, don’t use the entire table in a FILTER and replace SUMX if possible

Nested SUMX or DAX Query?

 

Best regards,
Yuliana Gu 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Review this article here:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

thanks for the link

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.