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!

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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

thanks for the link

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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