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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
SavioFerraz
Kudo Kingpin
Kudo Kingpin

Fiscal YTD calculation not respecting Month slicer in Power BI

Hello everyone,

 

I’m currently working on a Power BI report and I’m struggling a bit with a Year-to-Date calculation using a fiscal calendar. In my case, the fiscal year runs from July to June, and I have a proper Date table with Fiscal Year and Fiscal Month columns, along with a fact table that stores sales values. On the report page, I’m using two slicers: one for Fiscal Year and another one for Fiscal Month.

The issue I’m facing is that when I select a specific month, for example November, I expect my YTD calculation to accumulate values from July up to November of the selected fiscal year. However, the measure doesn’t always behave as expected. In some cases, it seems to ignore the selected month, and in other cases it accumulates values beyond the selected month, which makes the results confusing for end users.

I’m not using the built-in time intelligence functions because of the fiscal calendar, so I created a custom YTD measure using CALCULATE and FILTER with fiscal month logic. Even so, I’m still not confident that my approach is correct or aligned with best practices.

Has anyone dealt with a similar scenario? What is the recommended DAX pattern to correctly calculate Fiscal YTD while respecting both Fiscal Year and Fiscal Month slicers?

 

Thanks in advance for any guidance or suggestions.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

I tried to use new calendar option to simplify the DAX writing, and I tried to use disconnected fiscal month name table to create month name slicer.

 

Implement time-based calculations in Power BI - Power BI | Microsoft Learn

 

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1768363833973.png

Jihwan_Kim_1-1768363990748.png

 

Sales: = 
SUM(sales[sales])

 

Sales FiscalYTD: = 
VAR _fiscalmonthslicer =
    MAX ( 'Month name slicer'[Fiscal Month number] )
RETURN
    IF (
        [Sales:] && MAX ( 'Calendar'[Fiscal Month number] ) <= _fiscalmonthslicer,
        CALCULATE ( [Sales:], DATESYTD ( 'fiscalcalendar' ) )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

2 REPLIES 2
Kedar_Pande
Super User
Super User

@SavioFerraz 

Fiscal YTD = 
CALCULATE(
SUM(Sales[Value]),
FILTER(
ALL('Date'),
'Date'[FiscalYear] = SELECTEDVALUE('Date'[FiscalYear]) &&
'Date'[FiscalMonth] <= SELECTEDVALUE('Date'[FiscalMonth]) &&
'Date'[FiscalMonth] >= 7
)
)

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

Jihwan_Kim
Super User
Super User

Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

I tried to use new calendar option to simplify the DAX writing, and I tried to use disconnected fiscal month name table to create month name slicer.

 

Implement time-based calculations in Power BI - Power BI | Microsoft Learn

 

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1768363833973.png

Jihwan_Kim_1-1768363990748.png

 

Sales: = 
SUM(sales[sales])

 

Sales FiscalYTD: = 
VAR _fiscalmonthslicer =
    MAX ( 'Month name slicer'[Fiscal Month number] )
RETURN
    IF (
        [Sales:] && MAX ( 'Calendar'[Fiscal Month number] ) <= _fiscalmonthslicer,
        CALCULATE ( [Sales:], DATESYTD ( 'fiscalcalendar' ) )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

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

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.