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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Now is 2020 How to get 2021 Target amount ?

Hi All

I have 2020 sales target amount in PBI , i can view 2020 target amount using below expression :-

 
Target YTD =
var _max = today()
return
calculate(TOTALYTD(('TARGET_'[TARGET_]),'Date'[Date]),filter('Date','Date'[Date]<=_max))

or
 
Target_N_1 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))
 

I have add 2021 sales target amount to PBI , may i know how to modify the below expression , in order to display 2021 Target amount :-

 

Target_N_1 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))
 
Paul

 

1 ACCEPTED SOLUTION

@Anonymous , for 2021 this one should work, make sure date table has dates for 2021

 

Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

8 REPLIES 8
AllisonKennedy
Community Champion
Community Champion

@Anonymous 

 

Update the YTD measure: 

 

Target YTD =
var _max = MAX(Date[Date])
return
calculate(TOTALYTD(('TARGET_'[TARGET_]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
 
And add a filter or slicer for Date[Date] to your report, select year 2021 in the slicer, the target should update.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@Anonymous , Id this formula not working

Target_N_1 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))

 

This one should work

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit

 

Below are the expression work fine :-

 

For 2019 Target amount :-

Target_2019 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-3,YEAR)))

For 2020 Target amount :-

Target_2020 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-2,YEAR)))
For 2021 Target amount :-
Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-1,YEAR)))
 
May question is why 2020 current year , the expression using -2 ? why cannot using 0 , since it current year.
 
Paul 

@Anonymous  What is the last date in your Target table and last date in your Date table? This will impact what number (0, -1, -2, -3, etc) that you must use in the DATEADD function.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi Allison

 

In case now is 2020 Dec and i just add 2021 Target , what is the Date i should enter ? So that i can use 1 for 2021 as Target ?

 

Paul

Sorry @Anonymous  I don't understand your question. Where are you wanting to enter the date?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi Allison

I indicate the end date 2022. ( see my image below ) and my 2021 Target expression =

Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-1,YEAR)))

 

Paulyeo11_0-1608588614085.png

 

 

@Anonymous , for 2021 this one should work, make sure date table has dates for 2021

 

Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.