Forum Discussion

bwelsh's avatar
bwelsh
Helper I
9 years ago
Solved

DAX Calculated Table

I'm trying to create a calculated table based on a table with a colum for USER ID and EVENT ID (among others).

 

I need to create a table showsing disting USER ID's for only specific EVENT ID's. 

 

I've been trying to use the filter and disting functions but I'm not getting anywhere. Any help would be appreciated.

 

EDIT:

 

I think I may have figured this out with SUMMARIZECOLUMNS: 

 

CALCULATED TABLE = SUMMARIZECOLUMNS('Original Table'[USERID], FILTER('Original Table', 'Original Table'[EVENTID] = "SPECIFIC EVENT ID"))

  • Hi bwelsh,

    Please use the formula below to create new table.

    CALCULATED TABLE = DISTINCT( SELECTCOLUMNS(FILTER('Original Table', 'Original Table'[EVENTID] = "SPECIFIC EVENT ID"),"EVENTID",'Original Table'[EVENTID],"SPECIFIC EVENT ID",'Original Table'[SPECIFIC EVENT ID]))


    Best Regards,
    Angelia

4 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi bwelsh,

    Please use the formula below to create new table.

    CALCULATED TABLE = DISTINCT( SELECTCOLUMNS(FILTER('Original Table', 'Original Table'[EVENTID] = "SPECIFIC EVENT ID"),"EVENTID",'Original Table'[EVENTID],"SPECIFIC EVENT ID",'Original Table'[SPECIFIC EVENT ID]))


    Best Regards,
    Angelia

  • here are the steps:

     

    - click edit query

    - select both user id and event id column

    - right click on the header and click remove duplicates

     

    you will get disctinct rows

    • bwelsh's avatar
      bwelsh
      Helper I

      Wouldnt this modify the original table though? 

       

      I'm trying to create a seperate table.

      • parry2k's avatar
        parry2k
        Super User

        you can make duplicate of original table and then do the distinct on that, right click on original table and click "duplicate"