cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Roinka Regular Visitor
Regular Visitor

% per row and not per total

Hi there,

I have a matrix which shows the no of participants per category per type.

Category  | Type 1  |  Type 2 | Type 3

categoryA, 20, 40, 40                                                                          --(total 100 participants)

categoryB, 10,160,30                                                                          --(total 200 participants)

 

I am using a measure which holds the NoOfParticipants which is the CountRows of the table. The measure is auto   filtered by the category and type in the matrix.

 

I would like to present this as a % out of a total per row, so in above example we will get:

Category  | Type 1  |  Type 2 | Type 3

categoryA, 20%, 40%, 40%                                                                          --(total 100% participants)

categoryB, 5%,80%,15%                                                                              --(total 100% participants)

 

How do i create the second matrix?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: % per row and not per total

EDIT: I completely misread the question.  You can just use the Show Value As option in the dropdown of the measure in the matrix options to select Row Total.  This gives the results you want without any complicated measures.

 snipa.PNG

 

I'm leaving my previous answer below, just in case you find it interesting.

 

If you could share your current COUNTROWS measure, that would be incredibly helpful as a starting point for us.  

 

It seems likely that you can to use an expression like this that uses ISINSCOPE to determine if it is being calculated as a regular value or as a column total in a matrix.

NoOfParticipants for Matrix = 
IF( 
    ISINSCOPE(Table1[Type]), 
    [NoOfParticipants], 
    DIVIDE(
        [NoOfParticipants], 
        CALCULATE([NoOfParticipants], ALLSELECTED(Table1) ) 
    )*100 
)

 

View solution in original post

2 REPLIES 2
jthomson New Contributor
New Contributor

Re: % per row and not per total

Divide the first measure by itself, but in the second one use calculate and allexcept whatever the type field is

Super User
Super User

Re: % per row and not per total

EDIT: I completely misread the question.  You can just use the Show Value As option in the dropdown of the measure in the matrix options to select Row Total.  This gives the results you want without any complicated measures.

 snipa.PNG

 

I'm leaving my previous answer below, just in case you find it interesting.

 

If you could share your current COUNTROWS measure, that would be incredibly helpful as a starting point for us.  

 

It seems likely that you can to use an expression like this that uses ISINSCOPE to determine if it is being calculated as a regular value or as a column total in a matrix.

NoOfParticipants for Matrix = 
IF( 
    ISINSCOPE(Table1[Type]), 
    [NoOfParticipants], 
    DIVIDE(
        [NoOfParticipants], 
        CALCULATE([NoOfParticipants], ALLSELECTED(Table1) ) 
    )*100 
)

 

View solution in original post

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 285 members 3,123 guests
Please welcome our newest community members: