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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Missing value after sort by column

Hello,

 

My table contains the value and I added 4 more items with formula using - Var .... Return Switch (4 items I want to put), because otherwise 4 calculated formula won't show up in the table. The original table with 4 items show the whole value perfectly, although the sequence has changed. After I changed the item order by index using 'sort by column' the 4 items are missing. Is there anyone who had a same issue? Thank you.

 

Best regards,

Sichang

5 REPLIES 5
Jason6
Helper I
Helper I

https://www.sqlbi.com/daxpuzzle/unexpected-filter-behavior-in-calculate/solution/ 

https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...

 

This is the solution for measure values becoming blank or incorrect when we sort a column by another column

To fix the issue we need to include all(column name which is used to sort by)

So if Column A is sorted by Column B, 

Our measure should include 

calculate( expresession, filter criteria, all(ColumnB))

Hope this helps someone 🙂 

This is a fantastic solution. Thanks a lot. Not even AI tools like Copilot and Gemini was able to crack this

Anonymous
Not applicable

Hi! Were you ever able to resolve this? Same thing's happening to me. Thanks!

Anonymous
Not applicable

Hello,

 

I attached the screen shot below. I sorted the item - 1 by index column to make the right sequence.

 

But after sort by column, 4 items don't show the value anymore (these 4 items are formula: ROCE, EBITDA%, CM1%, Spec.CM1). I think it's because of the new measure I make: Item 1 - Act. I make a variable Item1new and return switch to present calculated item. (the calculated 4 items are not part of the original item - 1 so that's why I tried out in this way.)

 

Basically, the table is working before sort by column, but after sorting the item - 1, Item 1 - Act doesn't show the value for the calculated results.

 

It would be great if you can give me another approach or fix my formula. Thank you.example.PNG

Best regards,

Si Chang

amitchandak
Super User
Super User

Can you please explain with an example. If possible please share a sample pbix file after removing sensitive information.
Thanks

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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