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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PoojaReddy
New Contributor

Sorting applied in Power BI model is not getting applied in excel when connected to that model

Hi,

I have a table with four hierarchical levels, and each level has its own sort column. When I apply sorting for each level in Power BI Desktop based on its corresponding sort column, it works correctly. However, when connecting Excel to the same Power BI model published to the service, the sorting doesnโ€™t behave as expected โ€” all blank values are getting grouped together.

Data :

PoojaReddy_0-1760208005774.png

Expectation :

PoojaReddy_1-1760208035719.png

In Excel :

PoojaReddy_2-1760208394529.png

 

Can anyone please help on this ?

 

Thank you !

 

3 REPLIES 3
Greg_Deckler
Esteemed Contributor III

@PoojaReddy When you say "apply sorting for each level in Power BI Desktop based on its corresponding sort column" how are you doing that exactly? Because you can't define Sort by columns with the data that you have because you have multiple different sort values for blank values and that is not allowed.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
PoojaReddy
New Contributor

Hi @Greg_Deckler,

Thank you for the response !

We use Tabular Editor to make changes in the model hence it is getting treated with a warning. 

Our concern is mainly on the excel. Even though we have same sort order number for blanks it doesnt work in excel.

V-yubandi-msft
Honored Contributor II

This is a situation where Power BI Desktop and Excel handle things differently, even when working with the same model. When you use Tabular Editor to set the sort order, Power BI Desktop allows multiple blank values to have the same sort key, but Excel is stricter and groups all blanks together, ignoring the sort metadata.

 

You can try these options:

1. Replace blank values with placeholders like ~ or Undefined so Excel can tell them apart, and assign each a unique sort number.

2. Create a composite sort column, such as combining LevelName and SortOrder, and sort your display column by this new field to ensure uniqueness.

3. Check how Excel is applying the sort, especially if youโ€™re using a Pivot Table, as it may use its own sorting logic in addition to the modelโ€™s sort order.

 

Regards,
Yugandhar.

Helpful resources

Announcements
Users online (12,084)