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

View all the Fabric Data Days sessions on demand. View schedule

Reply
WNA247365
Frequent Visitor

Calculate percentage of total for matrix column

Hi, I have a matrix table where I want to have a value that gives the percentage for the column value for the row.    For example I have the following matrix table like the following:

 

Date Received:  | 2016-08-28

Delivered          | Samples         Relative%

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

Before 12          |       7                 0.12%

Before 3            |    122                2.09%

Before 5            |    192                3.29%

Before 7            |     807              13.82%

 

There are columns for 7 days so there columns and values for 6/28, 6/29, 6/30.....

My issue is that the Relative% column is the percentage for all the days and I just want it to be for that day.  I'd want "Before 7" to be 71.54%  I know that somehow I need to restrict the calculation to the context of the column instead of the entire dataset but I can't find how to do that.  I've tried several variants of calculate with counts and various filters but can't seem to figure it out.  Thanks in advance for any help

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @WNA247365

 

Try this measure:

 

% Relative =
DIVIDE (
    CALCULATE ( SUM ( Tabla1[Samples] ) );
    CALCULATE ( SUM ( Tabla1[Samples] )ALLEXCEPT ( Tabla1; Tabla1[Date Recieved] ) )
)

 

 




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

hi @WNA247365

 

Try this measure:

 

% Relative =
DIVIDE (
    CALCULATE ( SUM ( Tabla1[Samples] ) );
    CALCULATE ( SUM ( Tabla1[Samples] )ALLEXCEPT ( Tabla1; Tabla1[Date Recieved] ) )
)

 

 




Lima - Peru

Thank you very much Vvelarde!  Works perfectly.  My final measure calc was this:

 

Relative2 = Format(divide(calculate(counta('qrySpecimenTracking\'[Delivered])),CALCULATE((COUNTA('qrySpecimenTracking\'[Delivered])),ALLEXCEPT('qrySpecimenTracking\','qrySpecimenTracking\'[Date Received]))),"0.00%")

 

I just could not get that filter right :-).  Thanks again for you help and the quick reply!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors