Forum Discussion

Euro0681's avatar
Euro0681
Icon for Helper II rankHelper II
3 years ago
Solved

Static Baseline Value (Grouped on Category ID)

I'm trying to Calculate a baseline value which calculates a products weighted price by calculating "SUM(Amount)/SUM(Quantity)" at a given point in time but the value must remain static for all items ...
  • v-easonf-msft's avatar
    3 years ago

    Hi, Euro0681 

    You should try ALLEXCEPT ,like this:

    Baseline = 
    CALCULATE (
        DIVIDE ( SUM ( 'Table'[Amount] ), SUM ( 'Table'[Quantity] ) ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[ProductID] ),
            'Table'[_Period] IN { "2019 - 11", "2019 - 12", "2020 - 01" }
        )
    )

    Please check the sample file for more details.

    Best Regards,
    Community Support Team _ Eason