Forum Discussion

likmalik's avatar
likmalik
Icon for Helper I rankHelper I
5 years ago
Solved

Calculate Marketshare over 12months.

Hello,   I am trying to display the marketshare for various models over time and am struggling with which DAX formula to use. I have a simple table (country, brand, model, units sold, date). I wou...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    5 years ago

    Hi, likmalik 

     

    You can modify the measure:Add [Date]=SELECTEDVALUE(Sheet1[Date])

    VAR total =
        SUMX (
            FILTER ( ALLSELECTED ( Sheet1 ), [Date] >= startdate && [Date] <= enddate&& [Date]=SELECTEDVALUE(Sheet1[Date]) ),
            [Sales numbers]
        )
    VAR single =
        SUMX (
            FILTER (
                Sheet1,
                [Date] >= startdate
                    && [Date] <= enddate
                    && [Model] = SELECTEDVALUE ( Sheet1[Model] )
                    &&[Date]=SELECTEDVALUE(Sheet1[Date])
            ),
            [Sales numbers]
        )
    

     

    Best Regards

    Janey Guo

     

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