Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Extract Table from a table based on a criteria

Hey Gurus,

 

I would like to extract distinct value table from another table based on a criteria.

 

Extract Distinct Names and Class, excluding Mark X.

 

Example:

 

ClassNameMark
ATina 
ASamyX
ATony 
BLina 
BFadyX
EAdam 
EGina 
ESallyX
EMarina 
ATina 
ASamyX
ATony 
BLina 
BFady 
EAdam 
EGina 
ESallyX
EMarina 
  • Hi Anonymous 

     

    If I understand it correctly, you can create a new table with below DAX.

    New Table = DISTINCT(FILTER('Table', 'Table'[Mark] <> "X"))

     

    If you only want Class and Name columns in the new table, try

    New Table = SELECTCOLUMNS(DISTINCT(FILTER('Table', 'Table'[Mark] <> "X")),"Class",'Table'[Class],"Name",'Table'[Name])

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

4 Replies

  • Anonymous , New table

     

    calculatetable(Table, Table[MArk] <> "X")

     

    for visual table create a measure and use that with class and name

     

    calculate(countrows(filter(Table, Table[MArk] <> "X"))

  • Create a New table with using the following DAX statement and the result is in the table visual. Hope this is what is expected

     

     

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

     

    If I understand it correctly, you can create a new table with below DAX.

    New Table = DISTINCT(FILTER('Table', 'Table'[Mark] <> "X"))

     

    If you only want Class and Name columns in the new table, try

    New Table = SELECTCOLUMNS(DISTINCT(FILTER('Table', 'Table'[Mark] <> "X")),"Class",'Table'[Class],"Name",'Table'[Name])

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

  • Hi,

    To a Table visual, drag Class and Name.  In the Filter pane, provide a blank condition for the Mark column.