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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Yosi
Frequent Visitor

Issues with calculating percentages of occurence

Hi all,

I have gone through some answers here that are somewhat answer to my question but not quite. For example one answer talks about computing the percentage occurance of a limited number of categories in a column with labelled text categories.

I have a list of some 200 names of objects (say firms) in a dataset of 165 rows (cases) with some object names being repeated multiple times and some rows being blank. My problem is to do the following. Any help would be highly appreciated. I understand from the problem itself that this is basic  but I am very new to DAX

 

a) compute the percentage of times each name occurs across all cases 

b) keep this percentage constant when I apply a slicer to show only a few object names in a visual

 

I am able to just pull the object names and apply count to get the number of times each object name occurs (frequency). But a) how do I calculate the total of the number of times across all items? So my data table is like this:

Data
Cae noObject Name 
1L
2N
3K
4D
5W
6Y
7C
8G
9O
10X
11V
12T
13O
14Y
15V
16W
17N
18V
19B
20M
21T
22X
23J
24W
25Q
26A
27L
28W
29L
30N
31K
32D
33W
34Y
35C
36G
37O
38X
39V
40T
41O
42Y
43V
44W
45N
46V
47B
48M
49T
50X
51J
52W
53Q
54A
55L
56W
77M
82R
81Q
79O
80P
78N
67C
90Z
84T
70F
67C
70F
89Y
89Y
75K
74J
75K
67C
82R
70F
90Z
73I
75K
69E
68D
88X
65A
71G
67C
67C
83S
67C
69E
76L
69E
72H
77
  

 

The output required is like this: 

 Sample output to be represented in a clustered column with percentages for each object name
Object NameCount of Object NameTotal of CountsPercent Occurrence  
L21612.50%Percent Occurance needs to remain constant even when slicers are applied to select fewer items 
N31618.75% 
K21612.50% 
C41625.00% 
D31618.75% 
M1166.25% 
J1166.25% 
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Yosi , I tried creating a visual and I am not getting 2 for L, I am getting 5.

 

You need a measure like

 

divide(Count(Table[cae No]), calculate(Count(Table[cae No]), allselected() ) )

 

or

 

divide(distinctCount(Table[cae No]), calculate(distinctCount(Table[cae No]), allselected() ) )

 

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

The table at the bottom was meant as a sample of output required and not as an actual calculation from the data. I have accepted the solution by Asish Mathur as it worked for me.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors