Reply
avatar user
Anonymous
Not applicable

YTD,MTD,15 Days Sales calculation based on date selection on slicer

Hi All,

    

       I  need YTD,MTD, 15 Days sales calculation in a table based upon date selection slicer. how to calculate MTD, YTD sales based on date selected in a slicer.

 

Thanks,

Varsri

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You just need to create a measure using DAX function TOTALMTD and TOTALYTD like pattern below:, then result will be filtered by the slicer.

Result =
TOTALYTD (
    SUM ( InternetSales_USD[SalesAmount_USD] ),
    DateTime[DateKey],
    ALLSELECTED ( InternetSales_USD )
)

Result =
TOTALMTD (
    SUM ( InternetSales_USD[SalesAmount_USD] ),
    DateTime[DateKey],
    ALLSELECTED ( InternetSales_USD )
)

Community Support Team _ Jimmy Tao

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

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You just need to create a measure using DAX function TOTALMTD and TOTALYTD like pattern below:, then result will be filtered by the slicer.

Result =
TOTALYTD (
    SUM ( InternetSales_USD[SalesAmount_USD] ),
    DateTime[DateKey],
    ALLSELECTED ( InternetSales_USD )
)

Result =
TOTALMTD (
    SUM ( InternetSales_USD[SalesAmount_USD] ),
    DateTime[DateKey],
    ALLSELECTED ( InternetSales_USD )
)

Community Support Team _ Jimmy Tao

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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)