Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Grouping and Dates Formula

I have a set of table with repeated SO numbers. Can someone assit me in grouping the SO numbers together in the table with borders, so I can see how many repeated times per SO number. Shown below ...
  • v-jiascu-msft's avatar
    v-jiascu-msft
    8 years ago

    Hi Anonymous,

     

    I modify the old formula. Please try it again.

    Result =
    VAR minChangeDate =
        CALCULATE ( MIN ( 'Table'[Date of Change] ), ALL ( 'Table' ) )
    VAR maxChangeDate =
        CALCULATE ( MAX ( 'Table'[Date of Change] ), ALL ( 'Table' ) )
    RETURN
        DATEDIFF (
            CALCULATE (
                MIN ( 'table'[Old Value Date] ),
                FILTER ( ALL ( 'Table' ), 'Table'[Date of Change] = minChangeDate )
            ),
            CALCULATE (
                MAX ( 'table'[New Del Value Date] ),
                FILTER ( ALL ( 'Table' ), 'Table'[Date of Change] = maxChangeDate )
            ),
            DAY
        )
    

    About grouping:

    grouping =
    SUMX (
        SUMMARIZE (
            'Table',
            'Table'[Sales Order],
            [Old Value Date],
            [New Del Value Date],
            [Date of Change],
            "Value", [Result]
        ),
        [Value]
    )
    

    Grouping_and_Dates_Formula

     

    Best Regards,

    Dale