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
I am new to DAX, so I am working my way through a complex problem. I am looking to create a table from columns in other tables. Here is the description of what I am trying to do
http://community.powerbi.com/t5/Desktop/Combine-multiple-tables-into-one-table/m-p/60752#M24933
I understand the SelectColumns, but what i dont understand is how to implement filtering. I want to filter out data before i create my table.
Do i want to filter on the outside of the DAX query?
- Michaeldias3 years agoHelper I
Had the same problem but the solution seemed straight forward after reading up the documentation.
Table 1 = Column1 with values A,B,CThe following gives all of Table 1 as new Table 2
Table 2 =
SELECTCOLUMNS( 'Table 1'
, "Column 1 Alias", [Column 1]
)The following gives all of Table 1 without "A" as new filter Table 3 as the result of FILTER is a table
Table 3 =
SELECTCOLUMNS( FILTER ( 'Table 1', 'Table 1'[Column 1] <> "A" )
, "Column 1 Alias", [Column 1]
)