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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
M_SBS_6
Helper V
Helper V

Percentage by groups

Hi, 

If I have the following table

 

Hi, 

I have the following table and what I want to do is group up the row percentage based on the total value per ID. 

 

Example: The total value for ID 1 = 1000 so the 4 rows of values, I need to see the percentage of ID 1 total. 100/1000 = 10% etc. I have added in ID 2 as that follows the same pattern. At the moment, my % column is a percentage of the grand total which isn't what I want. Is there anyway to add a group by into the calculations please? 

 

ID. Value. %

1 100. 10%

1. 100. 10%

1. 300. 30%

1. 500. 50%

Total 1000. 100%

2. 200. 40%

2. 100. 20%

2. 200. 40%

Total. 500. 100%

1 ACCEPTED SOLUTION
amustafa
Super User
Super User

You can create a calculated column (not a measure) to get your desired results.

 

DIVIDE(
    [Value],
    CALCULATE(
        SUM(Table1[Value]),
        ALLEXCEPT(Table1, Table1[ID])
    )
)
 
amustafa_0-1706630133602.png

 

If I answered your question, please mark this thread as accepted and Thums Up!
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
amustafa
Super User
Super User

You can create a calculated column (not a measure) to get your desired results.

 

DIVIDE(
    [Value],
    CALCULATE(
        SUM(Table1[Value]),
        ALLEXCEPT(Table1, Table1[ID])
    )
)
 
amustafa_0-1706630133602.png

 

If I answered your question, please mark this thread as accepted and Thums Up!
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/





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

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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