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
rocky_puff
Frequent Visitor

Total Overall Value and Individual Value using the same Measure. How to divide them

Hi All.

 

I'm kind of stuck here. Need your help on this.

My problem is the measure used to get defect count and total defect count is the same, to differentiate it is using Plant (a column).  I want to calculate defect count weightage as per formula below:

Defect count weightage = defect count / total defect count

The total defect count is the row that I highlighted in the screenshot. How to get that value if it's using the same measure?

 

 

Here is the measure used to calculate the defect count.

 

DefectCount = SUMX(FILTER(Joined_FactAIVC,Joined_FactAIVC[DefectClass]<> "Produced Glove" && Joined_FactAIVC[DefectClass]<> "Good Glove"  && Joined_FactAIVC[DefectClass]<> "Empty Link"  && Joined_FactAIVC[DefectClass]<> "System Status"),[Value])

 

 

 

rocky_puff_0-1704790780679.png

 

Kindly help.

2 ACCEPTED SOLUTIONS

Not sure where you are going with this. Here is the standard approach 

 

lbendlin_0-1704981539770.png

 

But it feels like you need something different?

View solution in original post

Yaa I think this solved it. I chose different type of ALL previously. 

DIVIDE(CALCULATE([DefectCount]),CALCULATE([DefectCount],ALLSELECTED(TableABC[ID])))

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Above is the sample data that can be used.

My objective is to get the correct DAX to calculate defect count weightage.

Here is the formula 

Defect count weightage = defect count / total defect count


Example,

for  ID A : 767,212 / 1,993,685 = 0.3848

 

My current DAX,

DIVIDE(CALCULATE([DefectCount]),CALCULATE([DefectCount],ALL(Joined_FactAIVC))

which resulting to wrong output as below. The expected output is the same as the sample data above.

rocky_puff_0-1704959946616.png

 

 

Not sure where you are going with this. Here is the standard approach 

 

lbendlin_0-1704981539770.png

 

But it feels like you need something different?

Yaa I think this solved it. I chose different type of ALL previously. 

DIVIDE(CALCULATE([DefectCount]),CALCULATE([DefectCount],ALLSELECTED(TableABC[ID])))

ID

Defect Count

Defect Count Weightage

A

767,212

0.3848

B

504,089

0.2528

C

722,384

0.3623

Total

1,993,685

 

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.