Forum Discussion

patfee's avatar
patfee
Frequent Visitor
7 years ago

DAX Union with Measure Column

Table_1 contains Name, Description and Date

Table_2 contains Name, Description

 

in Table_2 i add the Date column by using measure column. The Date is based on a slicer value

 

When i then use DAX to Union both Table_1 and 2 i get an error as the tables are not equal.

 

in other words, the Date in Table_2, created by a measure, is not seen as a "real" column

 

How can i solve this please?

4 Replies

  • Hey,

     

    this DAX statement creates a table:

    Table = 
    UNION(
        Table1
        ,ADDCOLUMNS(
            SUMMARIZE('Table2'
                ,Table2[ID]
                ,Table2[thisorthat]
            )
            ,"amount", [amount]
        )
    )

    there is a measure "[amount]" this is added as a column using the function ADDCOLUMNS(...)

     

    But you have to be aware, that tables (outside of a measure) that are based on a DAX statement will only be re-calculated on data refresh and not if a query is issued, e.g. if a slicer is changed.

     

    Regards,

    Tom 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Tom,

      Is there anyway to make the table responsive to slicers?

  • Hey Anonymous , if you want to have this table appear in the fields pane, the simple answer is: no.

     

    You can use this table as a virtual table  inside other measures as input for calculation though.

     

    Regards,

    Tom