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
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

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

 

 

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

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

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

 

 

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft 

 

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
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.