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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Lohrasp
Frequent Visitor

Select a Column From a Calculated Table Inside a Measure

Hello,

 

I understand that I can do what I'm trying to do using the query editor by taking a few steps. However, I'm trying to do this "onthe fly" using one measure. I'm trying to create a table inside a measure, and then select one of the columns from that table:

 

1. Using group by, creates a table, which creates a new column : GROUPBY('Test Table', 'Col 1', "newCol", SUM(Col 2))

2. This produces a table with two columns: 'Col 1', and 'newCol'

3. I would like to select the 'newCol' column, and directly pass it to aggregate functions.

 

I can't seem to find a function in DAX that allows me to simply pick a column from a table, does one exist? For example, if such a function existed and was called SELECT_COLUMN, I would do:

 

SELECT_COLUMN(
    GROUPBY('Test Table', 'Col 1', "newCol", SUM(Col 2)),
    "newCol"

)

 

Thanks in advance for your help.

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

You mean like the SELECTCOLUMNS function?

 

https://msdn.microsoft.com/en-us/query-bi/dax/selectcolumns-function-dax

 

🙂



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hey Greg, thank you very much for taking the time to respond. 

 

I tried SELECTCOLUMNS and COLUMNSUMMARY, but both seemed to return a table rather than a column. The description of the SELCTCOLUMNS also says "Adds calculated columns to the given table or table expression." 

 

When I tried to previously pass SELECTEDCOLUMNS to a MIN function, I got an error that only a column can be passed to a MIN. So for example:

 

MIN( 
    SELECTEDCOLUMNS(Table1, "newCol", [newCol])
)

Bump

You need to use the "X" versions of the functions like MINX, SUMX, etc.

 

Sample data would help along with sample expected output.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.