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

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

Reply
Anonymous
Not applicable

Aggr function with column return from temp table

Dear all, 

I'm a newbie in DAX, in my lab I try to use SUMX function to sum all premium fee group by industry. 

My DAX function is below: 

EVALUATE
	var temp = 
	FILTER(
		SUMMARIZE(
			Premium_table,
			Premium_table[Industry],
			Premium_table[SUM PREMIUM]
			),
			
	[SUM PREMIUM] > 10000)
 
	RETURN 
		ADDCOLUMNS( 
			temp, 
			"sum_groupby_Industry" , SUMX(temp, temp[SUM PREMIUM])
		
		
		)

 

Tried with DAX studio, it failed with log "Query (15, 40) Cannot find table 'temp' , I think I have defined temp table in above already , could you please assist on my issue ? 

1 ACCEPTED SOLUTION

Hi,

Thank you for your message.

In my opinion, the below part was the cause, so I changed to the original table name. 

temp is a virtual table that is created inside the formula, but when creating it, it used the original column name ( Premium_table[SUM PREMIUM] ) in SUMMARIZE function.

 

Jihwan_Kim_0-1684124628851.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try the below whether it provides the desired result.

 

new addco table =
VAR temp =
    FILTER (
        SUMMARIZE ( Premium_table, Premium_table[Industry], Premium_table[SUM PREMIUM] ),
        [SUM PREMIUM] > 10000
    )
RETURN
    ADDCOLUMNS (
        temp,
        "sum_groupby_Industry", SUMX ( temp, Premium_table[SUM PREMIUM] )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

hi @Jihwan_Kim , 

It work, however I'm curious why my code didn't work ? temp table was defined already but dax still said "Cannot find table 'temp'" 

Hi,

Thank you for your message.

In my opinion, the below part was the cause, so I changed to the original table name. 

temp is a virtual table that is created inside the formula, but when creating it, it used the original column name ( Premium_table[SUM PREMIUM] ) in SUMMARIZE function.

 

Jihwan_Kim_0-1684124628851.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.