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
sbuster
Helper I
Helper I

DAX syntax and DAX Studio

Hello, I'm trying to understand why the following is failing in DAX studio (prob can do it in PowerBI, but I'm trying to learn DAX studio for more complex expressions).  What is causing issues is when / how to use combination of variables and tables.  

 

Example 1

DEFINE VAR x = .... (expression with table result)

EVALUTE X

This example works just fine even though x is a define as variable and not table.  Is it safe to assume EVALUTE will automatically recognize that?

 

Example 2

DEFINE VAR x = ...(expression with table result)

VAR t = FILTER(x....)

This example fails because "FILTER expects a table"..... Do I have to execute a return statement, do I need to instead define X as a TABLE vs VAR?

 

I know return "evaluates" and returns variable values but I'm not understanding how that is used in DAX studio vs PowerBI.

 

I can't seem to find any good docs / examples on how to combine these concepts, any help would be appreciated. 

 

1 REPLY 1
johnt75
Super User
Super User

A variable can hold either a table or a scalar value, e.g.

DEFINE
	VAR Numbers = GENERATESERIES( 1, 20, 1 )
	VAR LowNumbers = FILTER( Numbers, [Value] < 5 )

EVALUATE
LowNumbers

works fine. 

EVALUATE requires a table expression so if you can run EVALUATE x then x is definitely a table, and you can use it as a parameter to any functions that accept a table expression.

In DAX Studio you will mostly use EVALUATE rather than RETURN. EVALUATE executes a query whereas RETURN is mostly used in the definition of measures and calculated columns or tables. You might find the video at https://dax.guide/st/return/ helpful

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.