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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ericjo
Helper III
Helper III

summarize performance

hello, 
I made a measurement using the summarize function as below, but the speed is slow, so please help me if there is any way to improve it.

a : Cust_ID Summarize with one exter_id (Order_ID) based on the customer type "Rewards" based on Cust_ID
b : Check the quantity purchased by product using cust_ID of 'a'

# Purchase_1_A = 
var a =
FILTER(
SUMMARIZECOLUMNS('anl_dm_loyalty_sales_point_mart'[saguid])
                            ,CALCULATE(DISTINCTCOUNT('anl_dm_loyalty_sales_point_mart'[exter_id])
                                        ,'anl_dm_loyalty_sales_point_mart'[Cust_Type] = "Rewards"
                                        ,ALL('std_product_loyalty'[product_name])
                                        )=1)
							
var b = 
SUMMARIZE(CALCULATETABLE('anl_dm_loyalty_sales_point_mart'
                                        ,'anl_dm_loyalty_sales_point_mart'[Cust_Type] = "Rewards"
                                        ,'anl_dm_loyalty_sales_point_mart'[saguid] IN a
                                        )
                            ,[saguid]
                            ,[obj_id]
                            ,"Qty",CALCULATE(SUM('anl_dm_loyalty_sales_point_mart'[quantity])
                                                ,FILTER('std_product_loyalty','std_product_loyalty'[product_name] <> BLANK()))
)
                                                
Return
SUMX(b,[Qty])

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ericjo 
Any restrictions of using GENERATE function?

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @ericjo 
Any restrictions of using GENERATE function?

I will write Dax using GENERATE function.

The aggregate should be different depending on the date Between selection in the report, so we made Summarize from the Measure value, but is this the part that is considered?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.