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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tecumseh
Helper II
Helper II

Calculated Table Column Order

Hi all,

Can I control the order of the Columns in a calculated column?
In my DAX, I have the Date field listed 2nd in order, but the output shows the date column 3rd in order.

Thanks,

Try_1 = 
Summarize(
    FILTER(
        Sales,
        Sales[Channel] = "Education" &&
        Sales[Customer] <> "Adjustment" &&
        Sales[Net Revenue] > 0
    ),
    Sales[Customer Group ID],
    Sales[Begin Quarter Date],
    "Revenue",[Net Revenue]
)




3 REPLIES 3
parry2k
Super User
Super User

@tecumseh this is strange and ofcourse shouldn't require 2nd table to maintain the order of the columns. I will test it at my end and see if I can find anything. Super strange.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@tecumseh not sure if the order of the columns matters but I'm surprised why it is showing as 3rd instead of 2nd. You can wrap summarize in SELECTCOLUMN function and get the columns in the order you want.

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks parry2K,

I tried wrapping in SELECTCOLUMNS.
It did not work, still returning Revenue as 2nd column and the date as the 3rd column.

I played with it a bit more.
Now Revenue is 1st Column, Group ID is 2nd Column, Date is 3rd Column.
Even though I specified the complete opposite order in SELECTCOLUMN Wrapper.

I created a new Calulcated Table which refers to the 1st Calculated Table
Now the columns are in the correct order.
Seems I should not have to do this drastic step

DAX for 2nd Calc Table:

 

Try_2 = 
SELECTCOLUMNS(
Try_1,
"Customer Group ID", Try_1[Customer Group ID],
"Begin Quarter Date", Try_1[Begin Quarter Date],
"Revenue", Try_1[Revenue]
)




 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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