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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
kpansia
Frequent Visitor

Trying to sort a matrix but it messes up my measure on the matrix

Hey I have a matrix that looks like this. %A-%E is a measure.

When I try to sort the columns in a different way using Sort by Col and choosing the Number values of the colums. Example would be A = 1, B = 2, C = 3, D = 4, E = 5. When I try to sort them all the percentage values become 1 or 100%. Would anyone know why this is happeneing?

The matrix:

      |C   %C   E   %E   A   %A   D   %D   B   %B    Total   %Total|

      ---------------------------------------------------------------

Ro  | 1   .09   1  .09    4    .36   2    .18   4    .21        11        1     

Ro  | 2   .22   1  .11    2    .22   1    .11   5    .55         9         1

Ro  | 3   .24   3  .24    1    .08   3    .24   6    .48        13        1

The Matrix after I try to sort them. 

      |A   %A   B   %B   C   %C   D   %D   E   %E    Total   %Total|

      ---------------------------------------------------------------

Ro  | 1     1   1     1     4     1    2     1     4     1        11        1     

Ro  | 2     1   1     1     2     1    1     1     5     1         9         1

Ro  | 3     1   3     1     1     1    3     1     6     1        13        1

 

The Matrix I want:

      |A   %A   B   %B   C   %C   D   %D   E   %E    Total   %Total|

      ---------------------------------------------------------------

Ro  | 1   .09   1  .09    4    .36   2    .18   4    .21        11        1     

Ro  | 2   .22   1  .11    2    .22   1    .11   5    .55         9         1

Ro  | 3   .24   3  .24    1    .08   3    .24   6    .48        13        1

 The Measure I am using. It gives a percentage of the value based on the total of that row. 

% of peeps = DIVIDE(
DISTINCTCOUNT(Table[value]),
CALCULATE(DISTINCTCOUNT(Table[Value]), ALLSELECTED(Table[Column])))

 

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @kpansia

After sort the measure, please check data type of values, you should set the value with two decimals as follows.

1.PNG

Best Regards,
Angelia

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.