Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

percent used

For the time frame I've selected, I have had 43 work orders, in which, part number 307083-2 has been used 27 times, equalling a 62.79% usage rate.  What DAX formula do I use to display the percentage?  The current one I wrote is not working.

 

  • Anonymous's avatar
    Anonymous
    10 years ago

    Your model is weirding me out a little bit, wrt to the Part_Number table.  How does that relate to the WO Hdr?

     

    I would expect to see a relationship between WO_Line[PartNumber] and 'Part Number'[Part Number].

     

    One thing I would say for sure, is that I feel really good about:

      Total WO := COUNTROWS('WO HDR')

     

    Getting the count of distinct WO in WP_Line... trickier.

15 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Without seeing a bit more of your model, i'm not sure I can pull this off competely, but hopefully you get the idea :)

     

    Total WO := COUNTROWS(WorkOrders)  

    Total ALL WO := CALCULATE([Total WO], ALL(WorkOrders[PartNumber]))

    WO Percentage := DIVIDE([Total WO], [Total ALL WO])

     

    That make sense?  The 2nd measure it going to calc the Total WO's, but it will remove the PartNumber filters (from the part number you have on rows).  It will still keep any other filters you have (say, on a date range), so it won't be the all up grand total.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      This is almost perfect.  Here is my problem.  The "Total All WO" is only counting the "Total WO" that appear in the "WO_Line"table.  I need it to count all WO, instead of just the ones that have had "PartNumber" added to them.  I hope this makes since.

       

       

       

      • Sean's avatar
        Sean
        Community Champion

        Get rid of the column name [PartNumber] - just filter the table - ALL(WorkOrders) in the Total ALL WO Measure