cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Super User

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

4 REPLIES 4
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?

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)

How to Create Sort Column and Solve Related Errors:

Post Prodigy

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.

Super User

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors