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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Resolver III
Resolver III

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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