Forum Discussion
Return just one column from DAX table
- 3 years ago
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])
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])
- Anonymous3 years agoNot applicable
It's working 😄 Thank you!
- ssnegi19711 year agoFrequent Visitor
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