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
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
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.

Top Solution Authors