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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
YunJ
Post Prodigy
Post Prodigy

Can "Sort by measure" work if not all the matrix column has this measure?

Hi,

I have a measure named test1, and only Lip Stick has test1 value. Now I would like to Sort the visual by test1 as descending, which should be MNY, 3CE, LRL MU. But now as you can see it didn't sort by test1. Is it because I don't have test1 value for all the sub-category?

Capture.PNG

Thanks for your time.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @YunJ ,

Please try to create another measure with the below formula based on the measure "test1" , then drag it onto the matrix to replace measure “test1”:

Measure =
SUMX (
    VALUES ( 'Store'[Store_eng] ),
    SUMX ( VALUES ( 'Sub-Category'[Sub-Category] ), [test1] )
)

Best Regards

Rena

 

 

View solution in original post

11 REPLIES 11
Pragati11
Super User
Super User

HI @YunJ ,

 

What is the data-type of "test1"? Is it numeric or text?

If it is not numeric, modify the datatype and try sorting again.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11 

The test1 is "Whole number"

Capture.PNG

Hi @YunJ ,

 

If I see your new screesnhot, it looks like it is sorted on "test1" column in descending order.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

YunJ
Post Prodigy
Post Prodigy

I tried to adjust the measure so that each sub-category can have value, but it still cannot "Sort by test1" ...

Capture.PNG

@YunJ , Sorting on Matrix once the column is used will happen on row grand total of the measure. In case measure is not visible, check its data type

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak . It is numeric. 

Hi @Pragati11 @amitchandak 

 

I think I found the reason.

Here you can see when slicer Category=Skincare, the Total has value.

Capture.PNG

However, when Category=Makeup, the Total does not have value, so it didn't sort. 

But why Makeup does not have Total number? I wrote the same measure for them...

Capture2.PNG

Hi @YunJ ,

 

Looks like something is wrong on your Matrix TOTALS. Check them again. Also, check in your data is the matrix is showing right numbers.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11 

Thanks for your reply.

I checked the test1. The numbers shown in the matrix are correct. So it is really weird why only Makeup does not have the Total. Skincare has the Total...

Capture.PNGCapture2.PNG

Anonymous
Not applicable

Hi @YunJ ,

Please try to create another measure with the below formula based on the measure "test1" , then drag it onto the matrix to replace measure “test1”:

Measure =
SUMX (
    VALUES ( 'Store'[Store_eng] ),
    SUMX ( VALUES ( 'Sub-Category'[Sub-Category] ), [test1] )
)

Best Regards

Rena

 

 

Hi @Anonymous 

 

Thanks a lot for your solution.

May I know why the Total has value when selecting slicer Category=Skincare?

 

Thanks for your time.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.