Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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 by "Transfer Destination"

 

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))

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

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. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

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. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Yes it did, thank you so much. Such a simple change. Very much appreciated.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.