cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Calculating Percentages

Hi, I am trying to use a measure to produce % of Total column that shows the percentages of Compliant against Priority. I have goine wrong with the code below as it is not showing as a % of 100 - i.e. the first percentage should read 45.4374% (ideally want this rounded up to the nearest percent like 45% as long as the whole table adds up to 100%)

% of Total = DIVIDE( [Total Compliant], [All Compliant], 0)

 Priority Compliant All Compliant % of Total Product 1 966 2126 0.454374 Product 2 3 2126 0.001411 Product 3 32 2126 0.015052 Product 4 1 2126 0.00047 Product 5 23 2126 0.010818 Product 6 619 2126 0.291157 Product 7 404 2126 0.190028 Product 8 16 2126 0.007526 Product 9 62 2126 0.029163 Total 2126

Can anyone please help me with this? I am still new to Power BI and figuring things out.

Thank you,

1 ACCEPTED SOLUTION
Community Support

Hi @macgeorge ,

``````% of Total =
DIVIDE (
SUMX ( VALUES ( 'Table'[Priority] ), SUM('Table'[Compliant])),
SUMX ( VALUES ( 'Table'[Priority] ), [All Compliant] )
)``````

then select the measure ->  measure tools and change the format to percentage:

Result:

Best Regards,
Gao

Community Support Team

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

6 REPLIES 6
Super User

% of Total = DIVIDE( SUMX(VALUES(table[Priority]),[Total Compliant])[All Compliant]0)

Helper I

Hi Daniel, thank you for your reply. I am still getting 0.45% in that column. I am using this code as you suggested:

% of Total = DIVIDE(SUMX(VALUES(table[Priority]),[Total Compliant]),[All Compliant], 0)

Am I doing something wrong here?
Super User

=ROUND( DIVIDE( SUMX(VALUES(table[Priority]),[Total Compliant])[All Compliant]0),2)

can this work?

Helper I

The rounding works, thank you - but I am still not getting the % correct it should read 45% not 0.45%

% of Total = ROUND( DIVIDE(SUMX(VALUES(Table[Priority]),[Total Compliant]),[All Compliant], -0),2)
Community Support

Hi @macgeorge ,

``````% of Total =
DIVIDE (
SUMX ( VALUES ( 'Table'[Priority] ), SUM('Table'[Compliant])),
SUMX ( VALUES ( 'Table'[Priority] ), [All Compliant] )
)``````

then select the measure ->  measure tools and change the format to percentage:

Result:

Best Regards,
Gao

Community Support Team

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helper I

Thank you so much - this is excellent.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.