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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Antmkjr
Post Patron
Post Patron

How to get same period YTD across any previous years in a single formula

How to get the same period YTDs across any previous years in a single formula.

ie.  across a Matrix like this, i want the June YTDs across all years :

AnuTomy_0-1657627141314.png

 

1 ACCEPTED SOLUTION

I inserted it in the answer below.
It was this:

***************************************************

Month YTD =
VAR vMonth = MONTH(TODAY())
RETURN
CALCULATE(
[Sales Amount (YTD)],
'dCalendar'[Month] = vMonth)
***************************************************
 
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

View solution in original post

10 REPLIES 10
rodrigosan
Responsive Resident
Responsive Resident

Hello @Antmkjr  how are you?
would it be like this?

rodrigosan_0-1657627715558.png

 

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

can you share the formula

I inserted it in the answer below.
It was this:

***************************************************

Month YTD =
VAR vMonth = MONTH(TODAY())
RETURN
CALCULATE(
[Sales Amount (YTD)],
'dCalendar'[Month] = vMonth)
***************************************************
 
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

Would you mind attaching the pbix as well?

No I only want June YTD for all the years, ie. 2022 june YTD, 2021 June YTD,2020 June YTD etc in a single formula

I didn't understand the application very well.
This result can be obtained from the filter.

rodrigosan_0-1657628721608.png

 

Could you contextualize the objective?

 

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

Yes , but every month it should calculate automatically, so for next month it should calculate YTD August across all years, and then Sept YTD across all years so on.

 

See if this is it:

***************************************************

Month YTD =
VAR vMonth = MONTH(TODAY())
RETURN
CALCULATE(
[Sales Amount (YTD)],
'📅dCalendar'[Month] = vMonth)
***************************************************
rodrigosan_0-1657755120798.png

 

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

 

Could you pls attach the pbix?

Of course, here's the link: https://easyupload.io/z0udod

This is my test file.
These are fictitious data.

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.