Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Top 10 sorting

I have the following dax and I'm trying to sort (DESC) by "Transfers_X"  (Total Transfer_X), but I'm not sure what it's doing as it's not being sorted by this, nor is it being sorted alphabetically b...
  • Ashish_Mathur's avatar
    2 years ago

    Hi,

    Does this work?

    Top_10_Transfer_Destinations_LIst = 
    VAR Top10Destinations =
        TOPN (
            10,
            SUMMARIZE (
                DD_TRACE,
                DD_TRACE[Transfer Destination],
                "Total Transfer_X", SUMX (
                                        FILTER (
                                            RELATEDTABLE('TRANFERS_TRENDS'),
                                            NOT(ISBLANK('TRANFERS_TRENDS'[Transfers_X]))
                                        ),
                                        'TRANFERS_TRENDS'[Transfers_X]
                                    )
            ),
            [Total Transfer_X], DESC
        )
    RETURN
        CONCATENATEX ( Top10Destinations, DD_TRACE[Transfer Destination] & ": " & [Total Transfer_X], UNICHAR(10),[Total Transfer_X])

     Added the measure after the UNICHAR() function.