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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
Migasuke
Memorable Member
Memorable Member

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
Memorable Member
Memorable Member

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

  

Migasuke
Memorable Member
Memorable Member

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.