Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Select topn value without duplicate

Hi floks,
Here I facing an difficulties, that want to select TOP 20 rows from the table without duplicate of the same values.
I have tried these DAX to achive but it returns dupliacte rows.
DAX Query: TOPN(20,factQuotes,factQuotes[TotalValue],DESC)
it returns like shown below

Can any one please help me to crack this.


Thanks in advance,
Sivanesan C



  • Hi Anonymous ,

     

    We create a sample, that Total has two rows same value.

     

     

    Then we can create a calculate table using the following formula.

     

    Table 2 = 
    TOPN (
        20,
        SUMMARIZE (
            'factQuotes',
            'factQuotes'[Total],
            "name", CALCULATE ( MAX ( 'factQuotes'[name] ) )
        ),
        'factQuotes'[Total], ASC
    )

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    BTW, pbix as attached.

9 Replies