Forum Discussion

PavelAndreev's avatar
PavelAndreev
New Member
5 years ago
Solved

Adding new column with a grouped value.

Hi everyone, I have the following sample file: Segment Country Product Discount Band Government Germany Carretera None Government Germany Paseo None Government Canada Paseo ...
  • ryan_mayu's avatar
    5 years ago

    PavelAndreev 

    what's the purpose of create the addtional column? you didn't use it when you create a new table

    you can try this measure

    Measure =
    VAR tbl=SUMMARIZE('Sample','Sample'[Country],"product",count('Sample'[Product]))
    return COUNTROWS(FILTER(tbl,[product]>1))
  • Greg_Deckler's avatar
    5 years ago

    PavelAndreev You could create a new column in your existing table like this:

    Column = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Table',[Country]=EARLIER('Table'[Country])),"Product",[Product])))