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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 |
A | 1 |
B | 3 |
C | 3 |
D | 1 |
E | 1 |
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 😄
Solved! Go to Solution.
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])
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"
It's working 😄 Thank you!