Forum Discussion

sheeths82's avatar
sheeths82
New Member
4 years ago
Solved

MAX VALUE MULTIPLE CONDITIONS

Hi,

I have the below sample data 

The desired output is in Column I which Im trying to create in power BI, where the values show only for Unique work order and and department combination. The values in Column J is just the standard time multiplied by the qty. - this shows what the time should have been for that work order at that department.

 

If anyone can help with this, it would be appreciated.

Thanks!

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

     

    Desired outcome CC = 
    VAR _startdatetime =
        MINX (
            FILTER (
                Data,
                Data[WorkOrder] = EARLIER ( Data[WorkOrder] )
                    && Data[Department] = EARLIER ( Data[Department] )
            ),
            Data[StartDateTime]
        )
    VAR _condition = Data[StartDateTime] = _startdatetime
    RETURN
        Data[StandardTime/Unit] * DIVIDE ( _condition, _condition )
    

     

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

     

    Desired outcome CC = 
    VAR _startdatetime =
        MINX (
            FILTER (
                Data,
                Data[WorkOrder] = EARLIER ( Data[WorkOrder] )
                    && Data[Department] = EARLIER ( Data[Department] )
            ),
            Data[StartDateTime]
        )
    VAR _condition = Data[StartDateTime] = _startdatetime
    RETURN
        Data[StandardTime/Unit] * DIVIDE ( _condition, _condition )
    

     

    • sheeths82's avatar
      sheeths82
      New Member

      Worked perfect. Thank you so much for your help!!