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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
niemis
Frequent Visitor

Create Calculation/Measure that will count the number of a Change Type

I have a field in my data titled Change Type, and there are three options - Normal, Standard and Emergency.  I'm trying to create a measure/calc that will provide me the count of each option, so that I can get a percentage of the total number of changes. 

 

Any help would be awesome!!  

Thank you.

1 ACCEPTED SOLUTION

samratpbi_0-1710511479789.jpeg

As in above pic, Emergency has 3 rows / count out of total 9 rows / count, hence showing 3/9 = 33.33% and so other categories

View solution in original post

6 REPLIES 6
niemis
Frequent Visitor

Thank you @samratpbi !  It was my error.  Works perfectly!!!!

samratpbi
Solution Supplier
Solution Supplier

Hi,

Lets consider your data is like below:

Change Type Products
Normal    P1

Normal    P2

Standard P3

Standard P4

Standard P5

Standard P6

Emergency P7

Emergency P8

Emergency P9

Now, create below measures:
Count Distinct Products = DISTINCTCOUNT(table[Products])
Count All = CaLCULATE( [Count Distinct Products], ALL(table[Change Type])
Then your % calculation:
Count Pct = DIVIDE([Count Distinct Products], [Count All])

Thank you @samratpbi .  This gives me just the number 1, 1.00%, an 1, respectively.  

 

I have roughly 100 changes, most are normal type, but I am trying to determine what percent of those are standard and emergency.  

 

 

You need to use the last measure in the report and also format it as a percentage field

@samratpbi Thanks.  Maybe I am just not understanding.  So I'd like to be able to show that normal changes are x% of total changes

standard changes are x% of total changes

emergency changes are x% of total changes. 

 

 

samratpbi_0-1710511479789.jpeg

As in above pic, Emergency has 3 rows / count out of total 9 rows / count, hence showing 3/9 = 33.33% and so other categories

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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