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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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