Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply

YTD, MTD, QTD dax for fiscal year

Hi,

 

We have a slicer which will change between  YTD, MTD, QTD using selectedvalue dax we will populate the table. Our fiscal year starts on March

Currently, we are using these dax for YTD and QTD,
i) totalYTD = CALCULATE([total_amount], DATESYTD('dim_date (2)'[date_column], "28/2"))
ii) total
QTD = CALCULATE[total_amount]
    FILTER(

        ALL('dim_date (2)'[date_column]),
        'dim_date (2)'[date_column] >= STARTOFQUARTER(DATEADD('dim_date (2)'[date_column], 0, MONTH))
        && 'dim_date (2)'[date_column] <= MAX('dim_date (2)'[date_column])
    )
iii) totalMTD = SUM(amount) since the granuality of data is at a level of months
We are facing issues in YTD since febraury might be a leap year we are unable to give correct Year end date.
In QTD we are facing issue in which the QTD sums quarter based on calendar quarter.
Thank you
Yogesh
3 REPLIES 3
ThxAlot
Super User
Super User

My unique way to tackle any fiscal year questions, no matter a fiscal year ends in Feb or any month of the year.

DATES = 
ADDCOLUMNS(
    CALENDAR(
        EOMONTH( MIN( SALES[Date] ), -1 ) + 1,
        EOMONTH( MAX( SALES[Date] ), 0 )
    ),
    "FY Date", EDATE( [Date], -2 ),
    "FY Yr-Mth", FORMAT( EDATE( [Date], -2 ), "yyyy-MM" )
)

ThxAlot_0-1699434624220.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Hi @ThxAlot , 
Thank you for your fast replay. I have tried out the calendar table that you used but I am still getting the rolling total till Dec and not for Jan and feb. I have attached the sample pbi file

YogeshWaran2010_0-1699439177839.png
PBI File - click here

 

Use "FY Date" or "FY Yr-Mth" in viz.



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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