Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How do I return the ENTIRE table based on a particular distinct column value

Example this is my original Table:

 

I want to filter the table by UNIQUE CODE

Customer name:Code:Qty Value:
wushRTG45

wush

RTG50

abv

BAM90

art

CAV100

art

CAV100

 

How do I get a new table that is like this:

Customer name:Code:Qty Value:
wushRTG95

abv

BAM90

art

CAV200
  • Hi Anonymous ,

     

    There are two ways:

    1.You can directly put you columns into a table visual,then you will see:(for the field "Qty value",choosing "sum")

     

     

    Another way is to create a table using the dax expression below:

     

     

    Table 2 = SUMMARIZE('Table','Table'[Customer name:],'Table'[Code:],"Qty value",CALCULATE(SUM('Table'[Qty Value:]),ALLEXCEPT('Table','Table'[Code:])))

     

    And you will see:

     

     

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly

     

     

     

2 Replies

  • If you put same in table or Matrix, and sum qty you will get that.

    or

    New table = summarize(table,table[customer name],table[code],"Qty value",sum(table[qty value]))

     

    Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
    In case it does not help, please provide additional information and mark me with @

    Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
    Connect on Linkedin

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi Anonymous ,

     

    There are two ways:

    1.You can directly put you columns into a table visual,then you will see:(for the field "Qty value",choosing "sum")

     

     

    Another way is to create a table using the dax expression below:

     

     

    Table 2 = SUMMARIZE('Table','Table'[Customer name:],'Table'[Code:],"Qty value",CALCULATE(SUM('Table'[Qty Value:]),ALLEXCEPT('Table','Table'[Code:])))

     

    And you will see:

     

     

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly