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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

LIVE DATA: How to add sort column w/ DAX for specific column order?

Newbie to PBI. I have a live data source, and I am trying to add some items to a "pseudo table" in DAX. Since there is a live connection, I can't see my tables...at least that's the way I believe using DAX in this manner is supposed to work. If you look at my recent post history, you will see my goal is to sort in a specific order the columns of a matrix with the live data. I would do that with the 1, 2, 3, etc, that I am trying to add along the silver, gold, etc. If I am not doing this right, please suggest something I can do to achieve my objective, I am really floundering with this. 

 

StatsForThat_0-1665521122473.png

 

This is the code. 

 

ForSort = 
ADDCOLUMNS(
    VALUES(
        'Advisor Level'[Current Level]),
        "Index", 
        SWITCH(
            'Advisor Level'[Current Level],
            "No Goal Level", 1, "Silver", 2, "Gold", 3, "Gold Plus", 4, "Platinum", 5, "Diamond", 6
            )
        )

Thanks.

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , This is returning a table, In live connection, we can only create measures

 

In live connection, you can not mark a column as a sort column. You have to do that at the source

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors