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
Anonymous
Not applicable

YTD last year

Hi everybody,

 

I calculate a YTD and i try to compute The total YTD for the last year but it's give me a wrong value, it show me the total of the previous year:

 

Net TO YTD = TOTALYTD(SUM('QUERY MONTHLY RESULTS PBI'[Net turnover (OC)]); DATESYTD('Calendar'[Date]))

 

Net TO YTD Y-1 = CALCULATE([Net TO YTD];SAMEPERIODLASTYEAR('Calendar'[Date]))
 
How can i fix this? Can someone help me with this?
 
Thanks!
 
Best regards,
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @BhaveshPatel,

 

I slice by month an by Year and also change my Expression to calculate "Total Net TO of Last Year" by putting a new filter in my CALCULATE Function to keep the expression doing the right calcul, because by slicing the value change.

 

Best regards,

View solution in original post

Hi @Anonymous 

 

If you believe this answers your question, Please mark it as accepted solution so it can be helpful to others as well

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

6 REPLIES 6
BhaveshPatel
Community Champion
Community Champion

 

Hi @Anonymous 

 

You can use something like this:

 

 

[Prev Yr YTD] =

CALCULATE(SUM('QUERY MONTHLY RESULTS PBI'[Net turnover (OC)]), DATEADD(DATESYTD(Calendar[Date]),-1,Year))

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

Hi @BhaveshPatel,

 

Thanks for your reply!

I try what you suggest me but it's give me the same value as before.

The value is equal to Tatal of previous Year.

 

Best regards,

Hi @Anonymous 

 

If you slice it by MonthYear column from your calendar table, It will show the YTD and PreYTD Results.

 

If you are looking to get the YTD and PreYTD upto current period,

 

You can follow through the most recent article published on sqlbi:

https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/

 

There are quite a few different ways as well to get this outcome.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

Hi @BhaveshPatel,

 

I slice by month an by Year and also change my Expression to calculate "Total Net TO of Last Year" by putting a new filter in my CALCULATE Function to keep the expression doing the right calcul, because by slicing the value change.

 

Best regards,

Hi @Anonymous 

 

If you believe this answers your question, Please mark it as accepted solution so it can be helpful to others as well

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

Hi @BhaveshPatel ,

 

Thanks for your reply!

I try what you suggest me but it's give me the same value as before.

The value is equal to Tatal of previous Year.

 

Best regards,

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.