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
jesly_ajin
Helper III
Helper III

To calculate percentage based on specific columns in a matrix

Dear All,

 

Based on the below data I need another column named Percentage that calculates percentage as (Sum of 4 & 5 / Total ) * 100.

The below table is a matrix table. Kindly help.

 

@v-jianboli-msft Please help me.

 

jesly_ajin_0-1679894816448.png

 

1 ACCEPTED SOLUTION
jesly_ajin
Helper III
Helper III

I found a resolution to this as below:

 

Measure =
VAR Count45_ = CALCULATE (
COUNT ( VW_DetailLookUp[Response] ),
FILTER (
ALLEXCEPT ( VW_DetailLookUp, VW_DetailLookUp[FileLocation], VW_DetailLookUp[Questions] ),
OR ( [Response]="4-Agree", [Response]="5-StronglyAgree" )
))
VAR CountAll_ = CALCULATE (
COUNT ( VW_DetailLookUp[Response] ),
ALLEXCEPT ( VW_DetailLookUp, VW_DetailLookUp[FileLocation], VW_DetailLookUp[Questions] ))
RETURN
IF (SELECTEDVALUE ( ResponseMaster[Response] ) = "Sum of 4 & 5",
Count45_,
IF (SELECTEDVALUE ( ResponseMaster[Response] ) = "Percent",
DIVIDE(
Count45_,
CountAll_, 0
) * 100,
COUNT ( VW_DetailLookUp[Response] )
))

View solution in original post

5 REPLIES 5
jesly_ajin
Helper III
Helper III

I found a resolution to this as below:

 

Measure =
VAR Count45_ = CALCULATE (
COUNT ( VW_DetailLookUp[Response] ),
FILTER (
ALLEXCEPT ( VW_DetailLookUp, VW_DetailLookUp[FileLocation], VW_DetailLookUp[Questions] ),
OR ( [Response]="4-Agree", [Response]="5-StronglyAgree" )
))
VAR CountAll_ = CALCULATE (
COUNT ( VW_DetailLookUp[Response] ),
ALLEXCEPT ( VW_DetailLookUp, VW_DetailLookUp[FileLocation], VW_DetailLookUp[Questions] ))
RETURN
IF (SELECTEDVALUE ( ResponseMaster[Response] ) = "Sum of 4 & 5",
Count45_,
IF (SELECTEDVALUE ( ResponseMaster[Response] ) = "Percent",
DIVIDE(
Count45_,
CountAll_, 0
) * 100,
COUNT ( VW_DetailLookUp[Response] )
))

jesly_ajin
Helper III
Helper III

@Arul I did create another measure. But it does not work as expected.

As in the below figure, I need the percentage calculated based on [Sum of 4 or 5] / Total.

Also, the below figure gives an idea of the measure I already have.

Kindly help.

 

 

jesly_ajin_0-1679998525545.png

 

@jesly_ajin ,

check this thread, this might help you.

https://community.powerbi.com/t5/Desktop/how-to-add-percentage-column-in-the-end-of-the-matrix-table... 

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


@Arul Thanks for the response.

Arul
Super User
Super User

@jesly_ajin ,

try this,

Percentage = 
VAR _allValues = CALCULATE(
    SUM(Table[columnvalue]),ALL(table))
VAR _result = DIVIDE([Sum of 4 & 5],_allValues)*100
RETURN _result

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.