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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
prady2581
Helper I
Helper I

DAX Measure for % of each type of defect type in Text

I searched the forum not able to find the solution for below. The dataset has top defects types, I can show each type of defects as count but I want to also show these (each defect type) count of total defect type out of the total defect count. This is text field not able to find a solution for this. 

 

e.g. in below for Ticket idle % will 3/ 6*100 = 50 % 

 

Please help

 

 

% Bar Graph.png

 

 

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @prady2581

Two methods

 

1.

9.png

 

2. create a measure

Measure =
DIVIDE (
    CALCULATE (
        COUNT ( Sheet4[ticket] ),
        ALLEXCEPT ( Sheet4, Sheet4[gap reasons] )
    ),
    CALCULATE ( COUNT ( Sheet4[ticket] ), ALL ( Sheet4 ) )
)

10.png

 

Best Regards

Maggie

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @prady2581

Two methods

 

1.

9.png

 

2. create a measure

Measure =
DIVIDE (
    CALCULATE (
        COUNT ( Sheet4[ticket] ),
        ALLEXCEPT ( Sheet4, Sheet4[gap reasons] )
    ),
    CALCULATE ( COUNT ( Sheet4[ticket] ), ALL ( Sheet4 ) )
)

10.png

 

Best Regards

Maggie

 

petrovnikitamai
Resolver V
Resolver V

try to add measure

new measure  = divide(count([Gap Reasons]);countx(All([Gap Reasons]);[Gap Reasons])
Anonymous
Not applicable

thanks! this a good solution.

 

One additional problem: how could the expression be written in order to also consider a specific period of time in the dataset?

 

For example, my dataset is broken down by month and, when I filter in my visualizations by a specific month, the percentages don't change because the expression is considering the full dataset.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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