Forum Discussion

Pseifert's avatar
Pseifert
Frequent Visitor
6 years ago
Solved

Group By for calculated column

Hello,   I am trying to select the correct cycle speed with dax based on the MIN recipe #. My current measure below, however, does not account for an ITEM that has multiple resources. How can I ad...
  • v-chuncz-msft's avatar
    6 years ago

    Pseifert 

     

    You may use the following DAX to add a calculated column.

     

    Column =
    MAXX (
        TOPN (
            1,
            FILTER (
                V_SAP_NTEC_CI_CYCLES01,
                V_SAP_NTEC_CI_CYCLES01[ITEM_ID] = EARLIER ( V_SAP_NTEC_CI_CYCLES01[ITEM_ID] )
                    && V_SAP_NTEC_CI_CYCLES01[RESOURCE] = EARLIER ( V_SAP_NTEC_CI_CYCLES01[RESOURCE] )
            ),
            V_SAP_NTEC_CI_CYCLES01[RECIPE], ASC
        ),
        V_SAP_NTEC_CI_CYCLES01[CYCLE_SPEED]
    )