Forum Discussion

RexaZii93's avatar
RexaZii93
Icon for Helper I rankHelper I
4 years ago
Solved

How to sum value for fixed years

  Hi I have a data table which has multiple years in it (2019 to 2022). I would like to have a measure that if I chose the slicer from Jan 2022 to May 2022 on my date filter it should sum the vlau...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi RexaZii93 ,

     

    You need create an independent calendar table first which has no relationship with the fact table. The same as the following screenshot.

    Then create a measure like this:

    Measure =
    CALCULATE (
        SUM ( 'Fact table'[Values] ),
        FILTER (
            VALUES ( 'CALENDAR'[Date] ),
            MONTH ( [Date] )
                IN VALUES ( 'New calendar'[Month] )
                    && DAY ( [Date] ) IN VALUES ( 'New calendar'[Day] )
        )
    )
    

     

    Result:

     

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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