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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MAAbdullah_47
Helper V
Helper V

Reordering column problem

Dear Experts

I made a reordering for the columns based on business standard for my organization , I made it successfully in Power bi through query editor , Then when I go to DAX studio to write it as (csv) format I found it Alphabetically ( I understand this is natural) , after writing the file through Dax Studio when I open the file I find the column ordering not as the one I made it in power bi query editor. The size of the file is big (3 GB) cannot be opened in excel to reordering it , below the MDAX file sample of the columns as I want it , Can any one guide me how to solve this problem?

 


The MDAX Code:
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"order_id","quantity", "unit_price","returned_quantity","tax_exclusive_discount_amount_order_dt", "total_price_order_dt", "tax_exclusive_unit_price", "tax_exclusive_total_price", "void_reason","combo","combo_option_size","product_id", "is_ingredients_wasted","total_cost","sum_taxes_pivot_amount","sum_options_total_cost","sum_optional_taxes_pivot_amount", "status_detail","promotion", "original_order", "table", "driver", "customer", "customer_address", "discount", "coupon", "gift_card", "app_id", "promotion_id", "discount_type", "reference_x", "number", "type", "source", "status", "delivery_status", "guests", "kitchen_notes", "customer_notes", "business_date","subtotal_price", "discount_amount", "rounding_amount", "total price", "tax_exclusive_discount_amount", "delay_in_seconds", "opened_at", "due_at", "driver_assigned_at", "driver_collected_at", "closed_at", "created_at", "updated_at", "reference", "check_number", "branch_count", "table_count", "creator_count", "closer_count", "driver_count", "customer_address_count", "discount_count", "coupon_count", "tags_count", "promotion_count", "charges_count", "payments_count", "gift_card_count", "combos_count", "products_count", "original_order_count", "branch_id", "creator_id", "closer_id", "device_id", "customer_id", "customer_address_id", "discount_id", "coupon_id", "original_order_id", "closer", "creator", "meta", "accepted_at", "dispatched_at", "delivered_at", "customer_count","device_count", "payment_method_id_1" })

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Instead of getting the desired order in your model table, you could do the following.

 

1. Made a table visual in Power BI Desktop with the columns in the desired order.

2. View the Performance Analyzer, refresh the visual and then copy the query.

3. Paste that query in DAX Studio.

4. Export your data.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

Instead of getting the desired order in your model table, you could do the following.

 

1. Made a table visual in Power BI Desktop with the columns in the desired order.

2. View the Performance Analyzer, refresh the visual and then copy the query.

3. Paste that query in DAX Studio.

4. Export your data.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.