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
suhaily
New Member

How to calculate total and percentage for those who attend training by category.

My Sample data table in Power BI.

Picture1.png

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @suhaily ,

 

Try the following measures:

 

Total = 
CALCULATE(
    SUM('Table'[F]) + SUM('Table'[M]),
    ALLSELECTED('Table'),
    GROUPBY('Table', 'Table'[Category])
)
percentage = 
DIVIDE(
    [Total],
    SUMX( ALLSELECTED('Table'), 'Table'[F] + 'Table'[M] )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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-kkf-msft
Community Support
Community Support

Hi @suhaily ,

 

Does your problem have been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

v-kkf-msft
Community Support
Community Support

Hi @suhaily ,

 

Try the following measures:

 

Total = 
CALCULATE(
    SUM('Table'[F]) + SUM('Table'[M]),
    ALLSELECTED('Table'),
    GROUPBY('Table', 'Table'[Category])
)
percentage = 
DIVIDE(
    [Total],
    SUMX( ALLSELECTED('Table'), 'Table'[F] + 'Table'[M] )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

TomMartens
Super User
Super User

Hey @suhaily ,

 

please describe how the calculation should work and the expected result.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.