Forum Discussion
DAX - SelectColumns->Filter->Contains Syntax
Hi zamurr,
The syntax error here should be the Selectcolumns function Syntax error. When using Selectcolumns, the first parameter is a table expression, and after that there are pairs of parameters consisting of:
- A new column name
- An expression returning a column from the table given in the first parameter
Using Filter as the first parameter in your expression, Selectcolumns already have a table syntax, then the second ‘builds’ should be a new column name, but based on what has been posted, there are two table syntax here.
We may check the selectcolumns function with the following reference.
Using SelectColumns() To Alias Columns In DAX
Besides, could you please share about what you would like to achieve? Along with some data sample, we could offer some additional suggestions regarding DAX expression.
Please post back if any further assistance needed.
Regards
After my last post i realized that i needed to treat my DAX created table as the data table for the FILTER functions. Find the bold and underlined text to see my changes.
FlatTable = FILTER(SELECTCOLUMNS( build, "Index",build[Index], "MachineID",build[Machine], "UserAlias",build[Alias], "Branch",build[Branch], "Directory",build[StartPath], "BuildCommand",build[CommandLineString], "Razzle Cmd",build[Arguments], "Clean",build[Clean], "Parent",build[Parent], "BuildTime",build[BuildTime], "MachineType",LOOKUPVALUE(MachineInfo[Model],MachineInfo[MachineName],build[Machine]), "Manager",LOOKUPVALUE(Shell[Org_Mgr],Shell[Org_User],build[Alias]), "DM",LOOKUPVALUE(ShellDev[Org_DM],ShellDev[Org_User],build[Alias]), "DateTime",build[Time]), [Directory] = "shell")
- v-micsh-msft9 years agoMicrosoft Employee
Hi zamurr,
This one should work.
So what is your current situation?
Regards
- zamurr9 years agoMicrosoft Employee
It did not like the syntax. i actually moved on from this problem because i decided that i could filter with the slicers. I was hoping that creating a table using DAX would have made my querying faster, but that doesn't seem to be the case.