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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Marcus2
Helper I
Helper I

How to sum FYTD across multiple years (selecting end month in slicer)

I currently have to select all months leading up to the end month (in my slicer) to get my FYTD totals.  I would like to just select the end month.  Is there a DAX measure to achieve this across multiple years (using my slicer to select the end month)?  Thanks

 

ProductFYOctoberNovemberDecemberJanuaryFebruaryMarchAprilMayJunJulySeptember
Apples202355555555555
Oranges202355555555555
Apples202455555555555
Oranges202455555555555
Apples202555555555555
Oranges2025555        

 

 

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Marcus2 ,

 


To calculate Fiscal Year-To-Date (FYTD) totals by selecting only the end month in your slicer, you can use a DAX measure that dynamically determines the FYTD range based on the selected month and year. First, ensure you have a DateTable with columns such as Year, Month, Month Number, and Fiscal Year, and ensure it is linked to your data table. Then, create a measure to compute the FYTD total. This measure will calculate the total by filtering the data table for dates starting from the beginning of the fiscal year up to the selected month.

Here is the DAX measure:

FYTD Total = 
VAR SelectedMonth = MAX('DateTable'[Month Number])
VAR SelectedYear = MAX('DateTable'[Year])
VAR StartOfFiscalYear = DATE(SelectedYear - 1, 10, 1) 
VAR EndOfFiscalYear = DATE(SelectedYear, 9, 30)
VAR FilteredDates = 
    FILTER(
        ALL('DateTable'),
        'DateTable'[Date] >= StartOfFiscalYear &&
        'DateTable'[Date] <= EndOfFiscalYear &&
        'DateTable'[Month Number] <= SelectedMonth
    )
RETURN
CALCULATE(
    SUM('DataTable'[Value]), 
    FilteredDates
)

This measure works by first identifying the selected end month and year from the slicer. It then calculates the start and end dates of the fiscal year and filters the data table to include only dates within this range up to the selected month. The SUM function aggregates the values accordingly. With this measure, you only need to select the desired end month in the slicer, and the FYTD totals will be computed dynamically for the corresponding fiscal year. This approach eliminates the need to manually select all months leading up to the end month.

 

Best regards,

View solution in original post

2 REPLIES 2
Marcus2
Helper I
Helper I

Thanks, I think it works

DataNinja777
Super User
Super User

Hi @Marcus2 ,

 


To calculate Fiscal Year-To-Date (FYTD) totals by selecting only the end month in your slicer, you can use a DAX measure that dynamically determines the FYTD range based on the selected month and year. First, ensure you have a DateTable with columns such as Year, Month, Month Number, and Fiscal Year, and ensure it is linked to your data table. Then, create a measure to compute the FYTD total. This measure will calculate the total by filtering the data table for dates starting from the beginning of the fiscal year up to the selected month.

Here is the DAX measure:

FYTD Total = 
VAR SelectedMonth = MAX('DateTable'[Month Number])
VAR SelectedYear = MAX('DateTable'[Year])
VAR StartOfFiscalYear = DATE(SelectedYear - 1, 10, 1) 
VAR EndOfFiscalYear = DATE(SelectedYear, 9, 30)
VAR FilteredDates = 
    FILTER(
        ALL('DateTable'),
        'DateTable'[Date] >= StartOfFiscalYear &&
        'DateTable'[Date] <= EndOfFiscalYear &&
        'DateTable'[Month Number] <= SelectedMonth
    )
RETURN
CALCULATE(
    SUM('DataTable'[Value]), 
    FilteredDates
)

This measure works by first identifying the selected end month and year from the slicer. It then calculates the start and end dates of the fiscal year and filters the data table to include only dates within this range up to the selected month. The SUM function aggregates the values accordingly. With this measure, you only need to select the desired end month in the slicer, and the FYTD totals will be computed dynamically for the corresponding fiscal year. This approach eliminates the need to manually select all months leading up to the end month.

 

Best regards,

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors