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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
janwillem
Frequent Visitor

Column order

I have made a calculate column:

Inactive Group =  Calculate( IF('.....'[Days in-active] < 30; "< 30 days"; IF( '.....'[Days in-active] < 90; "30 < 90 days"; IF('.....'[Days in-acitve] < 365; "90 < 365 days"; "> 365 days"))))

 

Now I become de coloms as follow:

 

< 30 days  |  > 365 days  |  30 < 90 days  |  90 < 365 days

 

It should be:

 

< 30 days  |  30 < 90 days  |  90 < 365 days  |  > 365 days

 

How can I do that? 

Must I something change in the formula?

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

you can't change the order by changing your formula. The default order is derived from the values of signs representing the character code.

 

For this reason I would recommend to create a new table in the modeling section using this DAX statement

Inactive Group = 
UNION(
	ROW("Inactive Group", "< 30 days", "Sort Order", 1)
	,ROW("Inactive Group", "30 < 90 days", "Sort Order", 2)
	,ROW("Inactive Group", "90 < 365 days", "Sort Order", 3)
	,ROW("Inactive Group", "> 365 days", "Sort Order", 4)
)

 Next change the default order, goto the model pane mark the column of  "Inactive Group" and choose colum to sort by

2017-08-18_16-14-28.png

 

In the relationship pane connect the columns with the new table on the one side and your calculated column on the many side. Hide your calculated column from report view and just use the column from the new table.

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

you can't change the order by changing your formula. The default order is derived from the values of signs representing the character code.

 

For this reason I would recommend to create a new table in the modeling section using this DAX statement

Inactive Group = 
UNION(
	ROW("Inactive Group", "< 30 days", "Sort Order", 1)
	,ROW("Inactive Group", "30 < 90 days", "Sort Order", 2)
	,ROW("Inactive Group", "90 < 365 days", "Sort Order", 3)
	,ROW("Inactive Group", "> 365 days", "Sort Order", 4)
)

 Next change the default order, goto the model pane mark the column of  "Inactive Group" and choose colum to sort by

2017-08-18_16-14-28.png

 

In the relationship pane connect the columns with the new table on the one side and your calculated column on the many side. Hide your calculated column from report view and just use the column from the new table.

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

 Hi Tom

In this case the headers are numeric and special charachters, what if I want to move one column left or right?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.