Forum Discussion

Lance_CM's avatar
Lance_CM
Frequent Visitor
8 years ago

Assistance with Measure for Total Scheduled Ops

Hi All,

 

I would appreciate any assistance with how to structure my DAX formula, to determine “Total Scheduled Ops”?

 

My Model Logic, (Referencing the image below please)

  • My data source is “G1-Axz”
  • I have seven columns in my dataset
  • I have created a “Table” visualization in Power BI, and
  • I have introduced the following “Filters”
  • Harvest Week Production Unit Type
  • Area Name

 

Required,

  • I’m attempting to create a measure that will enable me to calculate the
  • Total Scheduled, Down Time, for the Operational responsibility, measure name is (Sched.Ops)

 

 

The result should be, 

  • Sched.Ops = 48.63 hrs

 

Any assistance will be most appreciated 

 

Cheers,
Lance

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    So Sched.Ops is the SUM of "Total Down Time (hrs)"? Is "Total Down Time (hrs)" a column or a measure?

    • Lance_CM's avatar
      Lance_CM
      Frequent Visitor

      Greg,

       

      • Total Down Time (hrs) is a column, for further clarification, please reference the introduced table?

      To provide context, this is the logic of my data and subsequent measures I have to derive,

      • I work on a 168 hr week (Monday morning 6am to Monday morning 6am)
      • Delays for the week period is captured against various production unit types
      • Delays are either scheduled or Unscheduled (Y or N)
      • Delays can also be attributed to either Operational, Mechanical or Electrical responsibility

       

      I am trying to determine the following DAX measures:

      • _Scheduled Ops Delay (hrs) =

      Typical Calculation syntax would be,

      IF ([Responsibility]="Operational")

      AND [Scheduled]="Y"

      THEN [Total Down Time (hrs)]

      END

       

      What would the DAX measure for "Scheduled Ops" be?

      I trial and errored my way to get a working formula, see code below?

      I'm not even sure whether this is the best approach?

       

      = CALCULATE('G1-Axz'[Total Down Time (hrs)], FILTER('G1-Axz'[Responsibility]= "Operational" && 'G1-Axz'[Scheduled (copy)] = "Y"))

      I was unable to get the OR formula to work for maintenance delays, that have to consider both mechanical and electrical delays?

       

      • _Unscheduled Maint Delay (hrs) =

      Typical Calculation syntax would be,

      IF ([Responsibility]="Electrical" OR [Responsibility]="Mechanical")

      AND [Scheduled]="N"

      THEN [Total Down Time (hrs)]

      END

       

      What would the DAX measure for "Unscheduled Maint" be?

       

      Any assistance will be appreciated mate?

       

      Cheers,

      Lance

       

       

    • Lance_CM's avatar
      Lance_CM
      Frequent Visitor

      Hi Greg,

       

      Can you please have a look at my response to your question?

       

      Cheers,

      Lance