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

Top Solution Authors