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
rodfernandez
Helper I
Helper I

Change Matrix Grand total of one measure from sum to average

Hello,
I have the following Matrix
 

Sin título.png

 

Each row come from a different measure. I need to change the grand total of the third row from SUM to Average, so from 100% to 91%, the measure of the third row is:

 

 

% este Mes =

VAR m = CALCULATE( MAX( Ejemplo[Mes] ); ALLSELECTED() )   //Select the number of the month selected in the slicer

RETURN IF(                                                 // if the % is bigger than 100% just show 100%, if not show the real %

    [Realizadas a la Fecha]/FIXED([Metas 2018]* m / 12;0;1)>1;

    1;

    [Realizadas a la Fecha]/FIXED([Metas 2018]* m / 12;0;1)   // Calculation of the %, using the numbers from the first row of the matrix ([Metas 2018]), the second row ([Realizadas a la Fecha]) and Variable m that is the selected month in the slicer of the page

)

Thanks

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

HI rodfernandez,

 

To be general, you may  modify your measure like pattern below:

 

% este Mes =
VAR m =
CALCULATE ( MAX ( Ejemplo[Mes] ); ALLSELECTED () )
VAR total =
SUMX (
Ejemplo;
[Realizadas a la Fecha]
/ FIXED ( [Metas 2018] * m / 12; 0; 1 )
)
RETURN
IF (
DIVIDE ( total; DISTINCTCOUNT ( [Metas 2018] ) ) > 1;
1;
DIVIDE ( total; DISTINCTCOUNT ( [Metas 2018] ) )
)

  Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

HI rodfernandez,

 

To be general, you may  modify your measure like pattern below:

 

% este Mes =
VAR m =
CALCULATE ( MAX ( Ejemplo[Mes] ); ALLSELECTED () )
VAR total =
SUMX (
Ejemplo;
[Realizadas a la Fecha]
/ FIXED ( [Metas 2018] * m / 12; 0; 1 )
)
RETURN
IF (
DIVIDE ( total; DISTINCTCOUNT ( [Metas 2018] ) ) > 1;
1;
DIVIDE ( total; DISTINCTCOUNT ( [Metas 2018] ) )
)

  Regards,

Jimmy Tao

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.