Forum Discussion

ADSL's avatar
ADSL
Post Prodigy
2 years ago
Solved

Find Product ID Active

Hello Community Team,   I have created and applied this measure to find the product ID active. With this measure, we will see the month that we stand/choose.   Product ID Active = CALCULATE(DIST...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ADSL ,

    I create a table as you mentioned.

    Then I create a new table.

    DateTable = CALENDAR(MIN('Sales Order'[Order Date]), MAX('Sales Order'[Order Date]))

    Next I create a measure and get what you want.

    Measure = 
    VAR _Previous =
        CALCULATE (
            DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
            'Sales Order'[InvoiceType] = "F2",
            'Sales Order'[Order Type] = "SALE",
            MONTH ( 'Sales Order'[Order Date] )
                = MONTH ( TODAY () ) - 1,
            YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
        )
    VAR _Current =
        CALCULATE (
            DISTINCTCOUNT ( 'Sales Order'[Product ID] ),
            'Sales Order'[InvoiceType] = "F2",
            'Sales Order'[Order Type] = "SALE",
            MONTH ( 'Sales Order'[Order Date] ) = MONTH ( TODAY () ),
            YEAR ( 'Sales Order'[Order Date] ) = YEAR ( TODAY () )
        )
    RETURN
        DIVIDE ( _Current - _Previous, _Previous, 0 )

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.