Forum Discussion

manuelfigueira's avatar
6 years ago
Solved

Extract unique values from a table into another table

Hello Everyone,

 

I'm trying to extract the unique values onto a calculated table but seems doestn work my DAX? I was using count function but doest work as it's taken every value and also I need summarize those values, means, the table B below should be the final table.

 

I have Table A and I need to get table B by extracting the info from table A to table B taking into account only unique values of the invoice  column

 

Table A

 

InvoiceActualStandard
A2212050
A2215030
A2211040
B3344510
B3345040
B34539010

 

Table B

 

InvoiceActualStandard
A22180120
B3349550
B34539010

Thank you very much!

 

 

 

 

  • the following will return a table you want:

     

    Summary Table = 
        SUMMARIZECOLUMNS(
            'Table'[Invoice],
            "Actual Total", SUM('Table'[Actual]),
            "Standard Total", SUM('Table'[Standard])
        )

     

3 Replies

  • edhans's avatar
    edhans
    Community Champion

    the following will return a table you want:

     

    Summary Table = 
        SUMMARIZECOLUMNS(
            'Table'[Invoice],
            "Actual Total", SUM('Table'[Actual]),
            "Standard Total", SUM('Table'[Standard])
        )

     

    • manuelfigueira's avatar
      manuelfigueira
      Helper II

      Hi Edhans,

       

      This works perfectly well! Thanks a lot!! You're a genius

       

      Enjoy your day!

      • edhans's avatar
        edhans
        Community Champion

        manuelfigueira wrote:

        You're a genius

        Ha! No.

         

        Coincidenally earlier this week I was working on a similar project and it took me about an hour to get a measure working right for me, and one of the components was a similar use of the SUMMARIZECOLUMNS() function. If you'd have asked last week, I might not have been the guy to answer. 😁

         

        Glad your project is moving forward.