Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Not consider duplicate IDs in a Top N

Hi all,   I´m trying to order a similar table in PBI, by sales desc. The thing is that I´d like to discard those companies with the same ID as it´s the case for Accesories and Accesories SL ...
  • rohit_singh's avatar
    rohit_singh
    4 years ago

    Hi Anonymous ,

    I have assumed that you have an ID column. Please try the following : 

    1. Create a calculated column on your table to give you the min value of company for each ID.

    Min Value =
    CALCULATE(
    MIN(CompSales[Company]),
    ALLEXCEPT(CompSales, CompSales[ID])
    )

     



    2) Using ths table, create a calculated table that has company and sales

    Min Sales =

    SUMMARIZE(
    CompSales,
    CompSales[Min Value],
    CompSales[Sales]
    )

     

    Kind regards,

    Rohit


    Please mark this answer as the solution if it resolves your issue.
    Appreciate your kudos! 😊