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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Kevin_Wantz
Frequent Visitor

SumX Formula Help for Optimal Performance

Hi All,

 

Hoping to receive some help on optimizing a SumX dax formula that currently is either not calculating and exceeding the total number of available resources, or calculates after taking 10 minutes minimum. The data model is a model to measure learning and development course completion for those in a specified target audience. For example, a course might only before Director's and Sr. Director's but another course may be geared towards the full company population. In essence, a curriculum can contain 10 or 20 different courses and I want a teammate to be counted as 1 if they completed all courses within the curriculum. Any ideas?

 

Meas.TotalCompleteALL =
SUMX (
    VALUES ( Audience[Course Name] ),
    CALCULATE (
        DISTINCTCOUNT ( 'Course Completion'[Teammate ID] ),
        FILTER (
            'Course Completion',
            [Meas.TargetCountALL] >= 1
                && 'Course Completion'[Course Name (groups)] >= [Meas.MinCourse]
                && 'Course Completion'[Course Name (groups)] <= [Meas.MaxCourse]
                && 'Course Completion'[Completion Status ID (groups)] = "COMPLETE"
        )
    )
)
 
Meas.CurriculumCompleteNewHire =
IF ( [Meas.TotalCompleteALL] >= [Meas.Curriculum_NewHires], 10 )
 
Meas.Curriculum_TotalCompleteAll_NewHire =
SUMX (
    FILTER (
        VALUES ( TeammateData[Teammate ID] ),
        [Meas.CurriculumCompleteNewHire] = 1
    ),
    [Meas.CurriculumCompleteNewHire]
1 REPLY 1
Anonymous
Not applicable

First of all, you should post the data model.

 

Second of all, no wonder this takes forever... You should know that:

 

1. Using a measure inside an iterator (like FILTER) is very slow if the cardinality of the iterator is big. Hence, iteration with a measure over a fact table will almost always be agonizingly slow and you'll never live to see the end of the calculation.

2. Nesting iterations is also a very bad idea (depending on the cardinality of the iterated tables).

3. DAX will be fast and easy ONLY WHEN your model is correct and built following the best practices. If your model sucks, then you'll start writing DAX which nobody - even you - will understand, especially after a while. Do you want it?

4. If your model is right, then DAX will be SIMPLE. SIMPLE means: easy to understand and to make changes to.

 

First, please paste your full model in here. Second, if you can, please put the file on a shared drive (like OneDrive) and send us a link to it so that we can play with the code and the model.

 

Thanks.

 

Best

Darek

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.