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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dokat
Post Prodigy
Post Prodigy

Change Row Order in a table

Hi i am trying to change the row order in a table. I created a measure using below formula and added to values but didnt work. Can anyone help?

 

Rearrange Rows = switch(selectedvalue('P&L'[P&L]),"Volume Sales",1,"Gross Sales",2,"Trade Discounts",3,"Off Invoice Sales",4,"BDF(includes rebates)",5,"Customer NS",6,"ANSP(Cents)",7,"Total Cost of Goods-MGT",8,"Customer P&L - Gross Profit",9)
 
Below is the cirrent order of the rows
ANSP (Cents)
BDF (includes rebates)
Customer NS
Customer P&L - Gross Profit
Gross Sales
Off Invoice Sales
Total Cost of Goods - MGT
Trade Discounts
Volume Sales
1 ACCEPTED SOLUTION

@dokat , leave default as blank(), in place of 9 and then try

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
dokat
Post Prodigy
Post Prodigy

I will give it a try with adding a column. Is there a way to do this without changing the source data, via measures?

amitchandak
Super User
Super User

@dokat , Create this as new column and mark it as a sort column of 'P&L'[P&L]

 

Rearrange Rows = switch(('P&L'[P&L]),"Volume Sales",1,"Gross Sales",2,"Trade Discounts",3,"Off Invoice Sales",4,"BDF(includes rebates)",5,"Customer NS",6,"ANSP(Cents)",7,"Total Cost of Goods-MGT",8,"Customer P&L - Gross Profit",9)

 

 

Sort Month.png

 

 

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

In actual table there are more rows that i shared on the sample data. In the query editor raw table there are total of 15 rows. If i just code the 9 it won't work.

 

@dokat , leave default as blank(), in place of 9 and then try

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.