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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Return just one column from DAX table

I have a dax table (code below) wich return two columns (sample below).

 

DaxTable =
var d = date(2022,9,30)
var _table = 
CALCULATETABLE(
SUMMARIZE(
	'Table',
	[Project],
    "Measure",
    CALCULATE(
    	COUNT('Table'[key]),
    		'Table'[status]<>BLANK())-
	CALCULATE(
		COUNT('Table'[key]),
			'Table'[status]="Fechadas")),
	'Table'[date]=d)
RETURN
FILTER(_table,[Measure]>0)

 

Project x
A1
B3
C3
D1
E1

 

I need to calculate the same approach and to return just the 'Project' column

Project
A
B
C
D
E

 

How can I solve this?

Thank you 😄

1 ACCEPTED SOLUTION
MAwwad
Solution Sage
Solution Sage

To return just the "Project" column from the table you have defined in your DAX code, you can use the SELECTCOLUMNS function to create a new table that contains only the columns you want to include.

 

DaxTable = VAR d = DATE(2022,9,30) VAR _table = CALCULATETABLE( SUMMARIZE( 'Table', [Project], "Measure", CALCULATE( COUNT('Table'[key]), 'Table'[status]<>BLANK())- CALCULATE( COUNT('Table'[key]), 'Table'[status]="Fechadas")), 'Table'[date]=d) RETURN SELECTCOLUMNS(_table, "Project", [Project])

View solution in original post

3 REPLIES 3
MAwwad
Solution Sage
Solution Sage

To return just the "Project" column from the table you have defined in your DAX code, you can use the SELECTCOLUMNS function to create a new table that contains only the columns you want to include.

 

DaxTable = VAR d = DATE(2022,9,30) VAR _table = CALCULATETABLE( SUMMARIZE( 'Table', [Project], "Measure", CALCULATE( COUNT('Table'[key]), 'Table'[status]<>BLANK())- CALCULATE( COUNT('Table'[key]), 'Table'[status]="Fechadas")), 'Table'[date]=d) RETURN SELECTCOLUMNS(_table, "Project", [Project])

Hi, I tried to SELECTCOLUMNS to return one column in the table but am getting the error : A Table of multiple values was supplied where a single value was expected"

DAX Indexed Table =
    VAR __SourceTable = 'Reports'
    VAR __Count = COUNTROWS(__SourceTable)
    VAR __SortText = CONCATENATEX('Reports',[ReportName],"|",[ReportNo])
    VAR __Table =
        ADDCOLUMNS(
            GENERATESERIES(1,__Count,1),
            "ReportNames",PATHITEM(__SortText,[Value],TEXT)
        )
    VAR _RTABLE = SELECTCOLUMNS(__Table,"ReportNames",[ReportNames])
RETURN _RTABLE
Anonymous
Not applicable

It's working 😄 Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.