Forum Discussion

Ktrain's avatar
Ktrain
Frequent Visitor
8 years ago
Solved

Calculate Dynamic Velocity based on the slicer selected

Hi Everyone,   I am trying to do calculate the average velocity for each skus base on the month slicer. I am really appriciate for any help. Thank you.  
  • v-juanli-msft's avatar
    8 years ago

    Hi Ktrain

    1.Create a calendar date table

    Table = CALENDAR(DATE(2018,1,1),DATE(2018,12,31))

    then in this table, create columns and measures

    columns, then add this column to the sliceron the report.

    calendar month = MONTH([Date])

    Measures

    min month = MIN('Table'[calendar month])
    
    max month = MAX([calendar month])

    2.create relationships between two tables

    3. create measures in the data table

    Assume data table is like this

    sum =
    CALCULATE (
        SUM ( Sheet6[velocity] ),
        FILTER (
            ALLEXCEPT ( Sheet6, Sheet6[skus] ),
            [month] >= [min month]
                && [month] <= [max month]
        )
    )

    numbers fo month =
    CALCULATE (
        COUNT ( Sheet6[month] ),
        FILTER (
            ALLEXCEPT ( Sheet6, Sheet6[skus] ),
            [month] >= [min month]
                && [month] <= [max month]
        )
    )

    aveage = [sum]/[numbers fo month]

     

    Best Regards

    Maggie