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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
snehawankhede
New Member

How to add a custom measure at the end of matrix view , instead of the Grand total at column level

I am looking to build a similar view in powerbi, but i am unable to add the measures at the end of the matrix chart. The % good and % not good, are custom measures at the end of matrix chart.

snehawankhede_0-1717670929900.png

 

Can someone please guide if this kind of view is achievable in Powerbi. Such views are easily achieveble in excel. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@snehawankhede 
I am glad to help you.
Based on your description, you can refer to my test below
You will need to create a “Head” table to assist the original table.

vjtianmsft_0-1717738420932.png

Here's my test data

vjtianmsft_1-1717738438622.png

vjtianmsft_2-1717738446544.png

vjtianmsft_3-1717738458428.png

M_result = 

SWITCH(TRUE(),
    SELECTEDVALUE(Header[category])="Material",
        SWITCH(TRUE(),
            SELECTEDVALUE(Header[name])="Wood",[M_1],
            SELECTEDVALUE(Header[name])="Particle Board",[M_1],
            SELECTEDVALUE(Header[name])="Iron",[M_1]
        ),
    SELECTEDVALUE(Header[category])="Others",
        SWITCH(TRUE(),
            SELECTEDVALUE(Header[name])="%Good",[M_%Good],
            SELECTEDVALUE(Header[name])="%Not Good",[M_%Not_Good]
        )
)
M_1 = 
CALCULATE(MAX('Table'[Opinion]),'Table'[Type]=SELECTEDVALUE(Header[name]))
M_%Good = 
VAR goodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Good"))
VAR goodNum02=
IF(goodNum=BLANK(),0,goodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(goodNum02,allNum,0)
M_%Not_Good = 
VAR notgoodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Not Good"))
VAR notgoodNum02=
IF(notgoodNum=BLANK(),0,notgoodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(notgoodNum02,allNum,0)

vjtianmsft_4-1717738533850.png

I uploaded the test file, you can refer to it.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi,@snehawankhede 
I am glad to help you.
Based on your description, you can refer to my test below
You will need to create a “Head” table to assist the original table.

vjtianmsft_0-1717738420932.png

Here's my test data

vjtianmsft_1-1717738438622.png

vjtianmsft_2-1717738446544.png

vjtianmsft_3-1717738458428.png

M_result = 

SWITCH(TRUE(),
    SELECTEDVALUE(Header[category])="Material",
        SWITCH(TRUE(),
            SELECTEDVALUE(Header[name])="Wood",[M_1],
            SELECTEDVALUE(Header[name])="Particle Board",[M_1],
            SELECTEDVALUE(Header[name])="Iron",[M_1]
        ),
    SELECTEDVALUE(Header[category])="Others",
        SWITCH(TRUE(),
            SELECTEDVALUE(Header[name])="%Good",[M_%Good],
            SELECTEDVALUE(Header[name])="%Not Good",[M_%Not_Good]
        )
)
M_1 = 
CALCULATE(MAX('Table'[Opinion]),'Table'[Type]=SELECTEDVALUE(Header[name]))
M_%Good = 
VAR goodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Good"))
VAR goodNum02=
IF(goodNum=BLANK(),0,goodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(goodNum02,allNum,0)
M_%Not_Good = 
VAR notgoodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Not Good"))
VAR notgoodNum02=
IF(notgoodNum=BLANK(),0,notgoodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(notgoodNum02,allNum,0)

vjtianmsft_4-1717738533850.png

I uploaded the test file, you can refer to it.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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