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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
PshemekFLK
Helper IV
Helper IV

DAX Optimizer - Filtered table as iterator

Hi, 

 

I just tried out the new free trial version of DAX optimizer tool and it flagged the issue with one of my measures. I was suspecting that it may be the one cuasing the performance issues in one of my reports so it's nice that the tool confirmed it. It flags the issue as "Filtered table as iterator" so I understand that putting a filtered table in the sumx is causing problems. Any idea how I could change the measure below to be less heavy on performance?

 

 

Final POS Total Calculated Cost Trx =
SUMX (
    FILTER (
        //sums all the distributors that doesn't have detailed POS and ensuring that detailed level will result in zero
        fct_high_level_pos_inv,
        IF (
            HASONEFILTER ( dim_product[Product Family Code] )
                || HASONEFILTER ( dim_product[BU (+)] )
                || HASONEFILTER ( dim_product[Model Group Code] )                
                || HASONEFILTER ( dim_product[Market Model Code] )              
                || HASONEFILTER ( dim_product[Model] )
                || HASONEFILTER ( dim_product[Item No (f)] ),
            BLANK (),
            COUNTROWS (
                FILTER (
                    fct_detailed_pos,
                    AND(fct_detailed_pos[Provider No] = fct_high_level_pos_inv[Provider No],
                        fct_detailed_pos[POS Month (+)] = fct_high_level_pos_inv[POS Month (+)])
                )
            ) = 0
        )
    ),
    fct_high_level_pos_inv[HL POS Cost Trx]*RELATED(dim_distributor[Net Revenue Factor POS (+)])
)+ [Det POS_Total Calculated Cost Trx]  // then adds all the detailed POS
 
 
What the measure doing is summing all the high level POS (from fct_high_level_pos_inv table) for those distributors that didn't report detailed POS (in fct_detailed_pos table) and ensuring that when filtering on detailed level (HASONEFILTER (dim_product[Product Family Code]|| HASONEFILTER ( dim_product[BU (+)] ) etc.) the measure will result in zero instead of showing a detailed number. 
1 REPLY 1
lbendlin
Super User
Super User

Their documentation/knowledge base shows potential workarounds. As always you want to use DAX Studio to validate that the change results in an actual improvement.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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