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 September 15. Request your voucher.

Reply
PshemekFLK
Helper IV
Helper IV

Turning nested SUMX into SUMMARIZE

Following this article: Nested SUMX or DAX Query? - P3 Adaptive I'm trying to turn nested SUMX formula into CALCULATE (SUMMARIZE) to improve performance

 

Nested SUMX (works correctly but extremely slow):

=SUMX( VALUES(dim_customer[id]),

                SUMX(VALUES(dim_product[id])),

                           [Plan])

 

SUMMARIZE:

=CALCULATE([Plan],

                      SUMMARIZE(fct_plan,dim_customer[id],dim_product[id])))

 

The problem is that the second formula gives me error:

The column 'dim_product[id]' specified in the 'SUMMARIZE' function was not found in the input table

 

I assume this is becuase fct_plan is connected to dim_product using bridge table on higher level than product[id] which is indeed not found in the fct_plan table:

 

summarize.png

Any way to adjust the SUMMARIZE formula to still be able to group by product[id]?

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @PshemekFLK ,

 

You should make sure the 'fct_plan" be the many side of these tables. So that it can get the value it needs.

Or you can try something like this:

=CALCULATE([Plan],

                      FILTER(fct_plan,fct_plan[customerID] in values(dim_customer[id])),

                      FILTER(fct_plan,fct_plan[productID] in values(dim_product[id]))))

 

If you need more help, please share your pbix file without sensitive data and expect output.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @PshemekFLK 

There is no relationship whatsoever between the customer id and the product id. SUMMARIZE won't help here. The only table that can relate both is the CROSSJOIN which basically would be the same as nested SUMX. Consider also that SUMX is a very well optimized function. 

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.