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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JBaker0585
Frequent Visitor

Alternate approach to SUMMARIZE

Stuck with a slow performing report, and I have a number of measures that are based on the below code only modifying the measure used in the CALCULATE call to get a different result.
I am putting this out to the group to see if I can find a better solution and move away from the use of SUMMARIZE which based on everything I have read is a performance nightmare.
 
__% Priority Orders Rank =
VAR MedianItems =
MEDIANX (
    SUMMARIZE (
        ALLSELECTED ( Sales ), Sales[bill_to_id], Sales[billto_customer_name] ),
            CALCULATE (
                [__% Priority Orders]
            )
    )
RETURN
IF ( [__% Priority Orders] > 0 && [__% Priority Orders] <= .5 * MedianItems, "A",
    IF ( [__% Priority Orders] > .5 * MedianItems && [__% Priority Orders] <= MedianItems, "B",
        IF ( [__% Priority Orders] > MedianItems && [__% Priority Orders] <= 1.5 * MedianItems, "C", "D"
        )
    )
)
2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi @JBaker0585 ,

 

If I should guess, it's not the SUMMARIZE-function which slows down your query, but the MEDIANX-function probably does. MEDIANX is an iterator function.

 

What is the purpose of the ALLSELECTED-function?

 

If you post a sample of your report, I can try to tune it.

Cheers,
Sturla

Thanks, @sturlaws. The ALLSELECTED was used in another piece of DAX that I modified for my particular solution. I have not attempted the code without it.

 

For my sample data, what exactly would you need to help you set up a test?

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.