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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
v-jtian-msft
Community Support
Community Support

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
v-jtian-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.