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
danielsouza
Helper III
Helper III

How to keep the same line order in table report?

I have this data model, with column DESCRIÇÃO ordered this way:

 

Order1.JPG

 

 

And I need to keep the same order in this table report:

 

Order2.JPG

 

 

 

Thanks a lot

Daniel

2 ACCEPTED SOLUTIONS
Hardik
Continued Contributor
Continued Contributor

you can sort the column Screenshot_8.pngScreenshot_9.png on both the data model and the report .Hope this helps @danielsouza

View solution in original post

danextian
Super User
Super User

Hi @danielsouza,

 

 

For the following steps, I am assuming that row order from your source file is the same as on  your screenshot  and the values in DESCRIÇÃO are unique - no duplicates. 

  • In the query editor, duplicate your original query. Right click on the query name from the query pane (left side) and then click Duplicate.
  • Select DESCRIÇÃO column, right click and then Remove Other Columns.
  • Filter the remaining column. Select Remove Empty. 
  • From Add Column tab, click Index Column. It doesn't matter whether your index starts from 0 or 1. 
  • Load the duplicate table to your model.
  • In the relationship view, drag DESCRIÇÃO  from the duplicate to the DESCRIÇÃO in the original table.
  • Once a relationship between the two is established, create a calculated colum in the original table. You can name it DESCRIÇÃO  sort order or anyway you want. The formula would be RELATED('Name of Duplicate Table'[Index]).  This calculated column will be used to custom sort DESCRIÇÃO.
  • Select the original DESCRIÇÃO column. From the Modeling tab in Power BI designer, click Sort by Column and select the calculated column in the prevoius step.
  • Put DESCRIÇÃO  in a table or matrix to check whether the custom sort order works.

 

Remove 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danielsouza
Helper III
Helper III

Guys, you rock!

 

@danextianand @Hardik

 

Thanks a lot!

danextian
Super User
Super User

Hi @danielsouza,

 

 

For the following steps, I am assuming that row order from your source file is the same as on  your screenshot  and the values in DESCRIÇÃO are unique - no duplicates. 

  • In the query editor, duplicate your original query. Right click on the query name from the query pane (left side) and then click Duplicate.
  • Select DESCRIÇÃO column, right click and then Remove Other Columns.
  • Filter the remaining column. Select Remove Empty. 
  • From Add Column tab, click Index Column. It doesn't matter whether your index starts from 0 or 1. 
  • Load the duplicate table to your model.
  • In the relationship view, drag DESCRIÇÃO  from the duplicate to the DESCRIÇÃO in the original table.
  • Once a relationship between the two is established, create a calculated colum in the original table. You can name it DESCRIÇÃO  sort order or anyway you want. The formula would be RELATED('Name of Duplicate Table'[Index]).  This calculated column will be used to custom sort DESCRIÇÃO.
  • Select the original DESCRIÇÃO column. From the Modeling tab in Power BI designer, click Sort by Column and select the calculated column in the prevoius step.
  • Put DESCRIÇÃO  in a table or matrix to check whether the custom sort order works.

 

Remove 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Works for me thanks

Hardik
Continued Contributor
Continued Contributor

you can sort the column Screenshot_8.pngScreenshot_9.png on both the data model and the report .Hope this helps @danielsouza

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.