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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AndreasG89
New Member

Creating new measure (Calculating Share)

Hey Guys,

 

I'm working on a "tricky" case to build a customized measure but at the moment I'm struggeling.

 

Scenario:

 

I have a table/list with 3 different failure roots cause (let's assume 1) Material 2)Human Error 3) Machine). I would like to calculate the share of the different failure root causes and multiply them with a specific factor. Afterwards I would like to present this result (in %) in a bar chart.

 

My issue is that I don't know to caculate the first step with the share of the different root causes. My first attemt with COUNT the column with root causes leads to the result that every bar had the same value (what is logical). 

 

So the basic questions is how to caculate the share between the single root causes?

 

Thank you very much for feedback guys!

 

Best Regards

 

Andreas

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@AndreasG89

 

According to your description, you want to calculate the percentage of all failures for each single failure type. Right?

 

In this scenario, you just need to use ALLEXCEPT() to have your COUNTROWS() calculation group on each failure type. Please refer to sample below:

 

Percentage of All = CALCULATE(COUNTROWS(),ALLEXCEPT(Table1,Table1[Failure]))/CALCULATE(COUNTROWS(),ALL(Table1))

4.PNG

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@AndreasG89

 

According to your description, you want to calculate the percentage of all failures for each single failure type. Right?

 

In this scenario, you just need to use ALLEXCEPT() to have your COUNTROWS() calculation group on each failure type. Please refer to sample below:

 

Percentage of All = CALCULATE(COUNTROWS(),ALLEXCEPT(Table1,Table1[Failure]))/CALCULATE(COUNTROWS(),ALL(Table1))

4.PNG

 

Regards,

Hi @v-sihou-msft,

 

this is exactly what I'm was looking for! Excellent!

 

Thank you very much!

 

Best Regards

 

Andreas

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.