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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Column and Grand Total Help

Hi - I am new to Power BI and have been trying to figure this out for awhile now. Ive tried several things I read online and have had no luck. The first pic below is an example of what my data table looks like, the second I did in excel, it is the desired outcome in powerbi. The values for each row are a count of ordernbr showing as % of row total, however for the grand total row the ask is for an avg of those percentages. Also for the column total the ask is to show the total count of ordernbr. Is this possible without creating another table just to show the avg total? Thank you in advance.

 

tia97_0-1680932105721.png

 

3 REPLIES 3
MohammadLoran25
Solution Sage
Solution Sage

Hi @Anonymous ,

It is a good question.

Assume your table name is 'ProductNbrTable'

Follow steps below:

 

1-

 

OrderNbrCount =
COUNTROWS ( VALUES ( ProductNbrTable[OrderNbr] ) )

 

2-

 

OrderNbrCountRowGrandTotal =
CALCULATE ( [OrderNbrCount], ALLSELECTED ( ProductNbrTable[GroupTAT] ) )

 

3-

 

Ratio =
DIVIDE ( [OrderNbrCount], [OrderNbrCountRowGrandTotal] )

 

4-

 

AvgOfRowPercent =
DIVIDE (
    IF (
        HASONEVALUE ( ProductNbrTable[GroupTAT] ),
        CALCULATE ( SUMX ( VALUES ( ProductNbrTable[Product_Priority] ), [Ratio] ) )
    ),
    CALCULATE (
        COUNTROWS ( VALUES ( ProductNbrTable[Product_Priority] ) ),
        ALLSELECTED ( ProductNbrTable[GroupTAT] )
    )
)

 

 

Then by putting measures of step 2 & 4, you get exactly the result you need.

 

If this answer solves your problem, give it a thumbs up and accept it as a solution so the others would find what they need easier.

Regards,

Loran

Anonymous
Not applicable

Thank you for taking time to take a look at this. Ive done steps 1-4 as you stated but Im not sure how to get the outcome outlined in the original post based off this (mainly the total row and columns)? Thank you in advance for any additional detail you can provide.

tia97_1-1681067221035.png

 

 

@Anonymous 

You did sth wrong I think because your result is different from what I got in my sample data based on your data. Make sure not to put the formula of a measure directly in another measure. Instead reference it. Like what I did in my 4 steps.

 

Then you just need to put the measures of step 2 & 4 in the matrix.

 

If you only want the Measure step 2 to be shown in the total (right section of matrix), you can omit the total of your first matrix (which in the last picture is 100%) and put the measure step 2 in a separate matrix and then put the second matrix exactly next to your first matrix To seems as a column of your first matrix.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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