Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have had help to create the below DAX measure but the last part in orange is not working the way I need it too.
I have a list of Machines that each fall into a certain process, there may be more than one machine in each process, what I need is a calculation I can use in the below where I need to divide the total scrap by the number of machines that come under the same process as at the minute the calculation is only dividing it by the total number of processes
Solved! Go to Solution.
Hi @Belle2015 ,
If you want to divide total scrap by the number of machines in each process (not by the number of total processes), your MachineCount measure needs to count the distinct machines for the current process.
Try changing your MachineCount to this:
MachineCount = CALCULATE( DISTINCTCOUNT('Work Order Value'[Machine]), ALLEXCEPT('Work Order Value', 'Work Order Value'[Process]) )
Then use:
TotalScrap / MachineCount
This way, MachineCount will return the number of unique machines for each process, so your calculation will divide total scrap by the correct number.
Let me know if this helps or if you need to tweak it for your model!
@Belle2015 ,Happy to help! If you run into anything else, feel free to ask.
Thanks for the feedback! 😊
HI @burakkaragoz ,
I ran into a problem when I went to use this in my actual data where I want to apply a date filter to see the values by month, I hadnt included the dates in my sample data, would I need to write something into the calculation to have it calculating by the date as at the minute it gets the total of scrap by process correct but when you split it out by the date the values by the date are not correct.
Any help would be appreciated.
Bronagh
Hi @Belle2015 ,
If you want to divide total scrap by the number of machines in each process (not by the number of total processes), your MachineCount measure needs to count the distinct machines for the current process.
Try changing your MachineCount to this:
MachineCount = CALCULATE( DISTINCTCOUNT('Work Order Value'[Machine]), ALLEXCEPT('Work Order Value', 'Work Order Value'[Process]) )
Then use:
TotalScrap / MachineCount
This way, MachineCount will return the number of unique machines for each process, so your calculation will divide total scrap by the correct number.
Let me know if this helps or if you need to tweak it for your model!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |