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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
NAOS
Advocate III
Advocate III

How to tell which functions can take calculated tables/columns as arguments and which don't?

Hi,

 

Sometimes it isn't so obvious or intuitive in which functions calculated tables/columns can be used as arguments. Does anyone know where I can find documentation or articles that would help to understand this better?

 

@marcorusso perhaps an article in sqlbi that I coudn't find reviews this?

 

Thank you,

 

NAOS

 

 

3 REPLIES 3
marcorusso
Most Valuable Professional
Most Valuable Professional

SUM is a shortcut for SUMX, I suggest you look at their syntax and examples on https://dax.guide

However, I stronlgy suggest you learn the DAX fundamentals first: row context, filter context, context transition.

There are many resources out there, including Microsoft documentation. You can also use this free video course: Introducing DAX Video Course - SQLBI

NAOS
Advocate III
Advocate III

Upon reading my question I think that, on trying to simplify it, I ended up asking the wrong question entirely.

 

What I'm trying to understand is how is it defined which DAX functions can use a DAX table or columns which are calculated within the measure as a variable?

 

For example this measure doesn't work:

example1 =

VAR _calculatedTable =

    SELECTCOLUMNS (

        'FactTable',

        "businessunit", 'FactTable'[Business Unit],

        "area", SUM ( 'FactTable'[Area] )

    )

RETURN

sum(_calculatedTable([area]) )

 

This measure does work:

example2 =

VAR _calculatedTable =

    SELECTCOLUMNS (

        'FactTable',

        "businessunit", 'FactTable'[Business Unit],

        "area", SUM ( 'FactTable'[Area] )

    )

RETURN

SUMX(_calculatedTable , [area] )

 

Why can SUMX take an expression-generated table as argument whereas SUM can't?

marcorusso
Most Valuable Professional
Most Valuable Professional

We already have DAX Guide for that.

For example:

- UNION gets tables as arguments: UNION - DAX Guide

- TRIM gets any text: TRIM - DAX Guide

 

Now, remember that any table expression in DAX can be converted to a scalar value as long as it has one column and zero or one rows. Therefore, you can try to pass a table to any function that accepts a scalar value (including TRIM - you have a runtime error if the table cannot be converted, but it's not a syntax error), whereas you cannot provide a scalar value when a table value is expected (this is a syntax error).

 

I hope it helps.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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