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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
mellas_k
Helper I
Helper I

How to Calculate Percentage using the total of column

Hello team please I need help,

I have this table :

Name   Number_A   Number_C

AA          5                         6

BB          9                       10

Total       14                      16

And I need to calculate  Number_C for each Name Divide by the total of Number_A

Exemple : I need to calculate:     (6/14)*100

                                                           (10/14)*100 …

NB : Number_A    / Number_C  are 2 calculate measure

 

Thanks for your help ,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Replace ALL(YourTable) with ALLSELECTED() and it should do the thing.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

 

You can create two measures:

 

Total_Number_A = CALCULATE([Number_A];ALL(YourTable))

Number_C / Total_Number_A % = DIVIDE([Number_C];[Total_Number_A])

Then just use Formatting options in Modeling tab of Power BI Desktop to make the last one measure formatted as percentage.

 

Hope that helps.

 

Cheers,

Pawel

hi @Anonymous

Thanks for you answer but the problem that  I use a filter so when I use 

Total_Number_A = CALCULATE([Number_A];ALL(YourTable))

It gives me all the count … 

Anonymous
Not applicable

Replace ALL(YourTable) with ALLSELECTED() and it should do the thing.

@Anonymous

thanks for your help

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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