Forum Discussion

Sanmaya's avatar
Sanmaya
Frequent Visitor
2 years ago

Why this DAX is not working?

Need to create a temporary table using the existing table which will be created by the selected value from the table, hence wrote the DAX  in new table option to create the temp table.

FILTER(MainTable,MainTable[Work Order No.]=SELECTEDVALUE(MainTable[Work Order No.]))
 
but this is showing empty table . what is wrong in this DAX?

4 Replies

  • Hi,

    I am not sure how your expected outcome looks like, but please try something like below.

    Please check the below picture and the attached file whether it suits your requirement.

     

     

    expected result table =
    VAR _selectorder =
        SUMMARIZE (
            FILTER ( MainTable, MainTable[Work Order No.] IN { 1, 2, 4 } ),
            MainTable[Work Order No.]
        )
    RETURN
        FILTER ( MainTable, MainTable[Work Order No.] IN _selectorder )
    

     

     

  • Sanmaya's avatar
    Sanmaya
    Frequent Visitor

    This is not the solution , which i am looking for.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Sanmaya 

     

    Do you want the Work Order No. column to be a column in the new table?

     

    Perhaps the following can help.

     

    My sample:

     

    Create a calculated table

    Table 2 = VALUES('Table'[ID])

     

    Output:

     

    Best Regards,
    Yulia Xu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Sanmaya's avatar
      Sanmaya
      Frequent Visitor

      I think, i have not clearly expained  my requirement. i want to filter a table based on seleceted value. what should be DAX for to Filter the Table based on selected value. My DAX is 
      Table1=FILTER(MainTable,MainTable[Work Order No.]=SELECTEDVALUE(MainTable[Work Order No.]))

      Main table has a column Work Order no and which whould be Filtered Using the Value from SelectedValue() function.