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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
samm
New Member

To show actual % instead of average

Hey , 
I'm using a matrix visual shown above . Here I'm showing both whole number and % values in total 
1st and 2nd row is numerator and denominator whereas 3rd one is num/den. 3rd row is showing avg of those percentages. But I need to show the actual percentage of numerator/denominator. How can I fix this ? please help  

samm_0-1715412751349.png

 

2 ACCEPTED SOLUTIONS
xifeng_L
Solution Sage
Solution Sage

Hi @samm ,

 

You can try below measure:

 

Measure = 
VAR RowItem = SELECTEDVALUE('Table'[RowField])
VAR _Num = CALCULATE(SUM('Table'[Num]),'Table'[RowField]="1st Row Item")
VAR _Den = CALCULATE(SUM('Table'[Den]),'Table'[RowField]="2nd Row Item")
RETURN
SWITCH(
    RowItem ,
    "1st Row Item",FORMAT(_Num,"#,##0"),
    "2nd Row Item",FORMAT(_Den,"#,##0"),
    "3rd Row Item",FORMAT(DIVIDE(_Num,_Den),"0.00%")
)

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

View solution in original post

v-jtian-msft
Community Support
Community Support

Hi,@samm .Hello,@xifeng_L@Ritaf1983

thanks for your concern about this issue.

Both of your answers are excellent! And I would like to share some additional solutions below.
I am glad to help you.

If you want to change the value of total to the percentage of the sum of two values, you can refer to my test below.

You can refer to my test below

 

Here is my test data

vjtianmsft_0-1716877564808.png

 


Show it in a matrix and change the option in the values setting (turn this option on)

“Show values in row groups rather than columns”

vjtianmsft_1-1716877564810.png
vjtianmsft_2-1716877621410.png

Create a measure, put it in a matrix

M_result = 

VAR sum1=SUM('Table'[Value_1])
VAR sum2=SUM('Table'[Value_2])

    RETURN 
    DIVIDE(sum2,sum1)

The results are as follows.

vjtianmsft_3-1716877706037.png

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

3 REPLIES 3
v-jtian-msft
Community Support
Community Support

Hi,@samm .Hello,@xifeng_L@Ritaf1983

thanks for your concern about this issue.

Both of your answers are excellent! And I would like to share some additional solutions below.
I am glad to help you.

If you want to change the value of total to the percentage of the sum of two values, you can refer to my test below.

You can refer to my test below

 

Here is my test data

vjtianmsft_0-1716877564808.png

 


Show it in a matrix and change the option in the values setting (turn this option on)

“Show values in row groups rather than columns”

vjtianmsft_1-1716877564810.png
vjtianmsft_2-1716877621410.png

Create a measure, put it in a matrix

M_result = 

VAR sum1=SUM('Table'[Value_1])
VAR sum2=SUM('Table'[Value_2])

    RETURN 
    DIVIDE(sum2,sum1)

The results are as follows.

vjtianmsft_3-1716877706037.png

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.

 

xifeng_L
Solution Sage
Solution Sage

Hi @samm ,

 

You can try below measure:

 

Measure = 
VAR RowItem = SELECTEDVALUE('Table'[RowField])
VAR _Num = CALCULATE(SUM('Table'[Num]),'Table'[RowField]="1st Row Item")
VAR _Den = CALCULATE(SUM('Table'[Den]),'Table'[RowField]="2nd Row Item")
RETURN
SWITCH(
    RowItem ,
    "1st Row Item",FORMAT(_Num,"#,##0"),
    "2nd Row Item",FORMAT(_Den,"#,##0"),
    "3rd Row Item",FORMAT(DIVIDE(_Num,_Den),"0.00%")
)

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Ritaf1983
Super User
Super User

Hi @samm 

You can use isinscope function to manipulate the totals.

Please refer to the linked tutorial :
https://www.youtube.com/watch?v=xAZY9FyLDPo&t=2s

For more specific suggestion 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.