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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
tum
Regular Visitor

Do not see how to calculate percentage

Hi all, 

First many thanks to allow us aking for support, 

I am quite new in powerBi and still having bas reflex I guess. 

I am trying to calculate some percentage but i failed and very frustrated as in Excel It would take me seconds

My table is as below 

Count of Field1 means I have in the Table many records with code =1 or Code =2 etc.. up to 100 000 for code 1 for example 

 

Code   count of field1   

1          100 000       %?                  

2           1000           %?      

3           2000

4           500

5           700 

Total =  104  200

 

I am trying to calculate the % of each "count-of-record- per code and loss my hair. 

Any help would be very appreciated. 

1 ACCEPTED SOLUTION

I am not sure what do you mean by Field 1, 2, 3...
But logic should be the same. Instead of SUM for numbers you will use COUNT.

Count of Codes = COUNT(Table[CodeID])
All Codes = CALCULATE([Count of Codes],ALL(Table))

In case this is not helpful, please provide me a printscreen from excel with input and expected output.

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

4 REPLIES 4
tum
Regular Visitor

Thanks it works as well 

Migasuke
Solution Sage
Solution Sage

Hi @tum ,

One of the optionn you can do is to use CALCULATE with a combination of ALL. This would give you the Grand total, which you can later divide with row level values.
For example I have this sample report with 3 measures:

Sales = SUM(financials[ Sales])
All Sales = CALCULATE([Sales],ALL(financials))
% Sales = DIVIDE([Sales],[All Sales])

Outcome looks like this:
Migasuke_0-1672778495418.png´
In case of any question, let me know.

 

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Thanks a lot for your help. 

Have you noticed that "Count of field 1" means "count" of all rows with code 1 and not a number. 

This is my point. 

My table is as such : 

code     Field1   field2 field3          

1            x          x          x         

2           x          x          x      

1           x          x          x

1          Y           Z         a

2         Y           Z         a 

 

Then I calculate how many code 1, code2 etc...  (count of field) 

Then I am trying to calculate % of code 1 rows of  all rows so total of code 1 rows / total rows

So % of each code rows / total of rows

Thks for your help

  

I am not sure what do you mean by Field 1, 2, 3...
But logic should be the same. Instead of SUM for numbers you will use COUNT.

Count of Codes = COUNT(Table[CodeID])
All Codes = CALCULATE([Count of Codes],ALL(Table))

In case this is not helpful, please provide me a printscreen from excel with input and expected output.

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors