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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Antmkjr
Helper V
Helper V

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors