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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

How to get 2021 target amount ?

Hi All

My master claendar date set as below :-
Date = CALENDAR(Date(2000,01,01),date(2020,12,31))
My Target 2020 expression :-
Target_2020 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-0,YEAR)))
 
In order to get Target 2021 expression , i have try , i cannot get 2021 Target :-
 
Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],1,YEAR)))
it return 2020 Target.
Target_2021 = CALCULATE([TARGET_], DATESYTD(DATEADD('Date'[Date],-1,YEAR)))
it return 2020 Target.
 
May i know where go wrong ?
 
Only way is i need to change the below year from 2020 to 2021 :-
Date = CALENDAR(Date(2000,01,01),date(2020,12,31))
Which i don;t want.
 
Paul
 
 
1 ACCEPTED SOLUTION
LillyLegenda
Helper III
Helper III

Hi Paul, maybe you can do 

Date2 = CALENDAR(Date(2000,01,01),date(2021,12,31))

and use that for 2021.

View solution in original post

7 REPLIES 7
VijayP
Super User
Super User

I am referring the Date in Date Dimension you have created using Calendar or Calendarauto




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
Super User

@Paulyeo11  I mean the (Date) is the dim table name and other field based on your data structure. 

The error because those fields were not part of your data hence you need to repalce your actual data field names to get the result




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Paulyeo11
Impactful Individual
Impactful Individual

Hi Vijay

Are your ref to this Date :-

Paulyeo11_0-1609684550142.png

Or this Date :-

Paulyeo11_1-1609684629745.png

 

VijayP
Super User
Super User

@Paulyeo11 

Instead of using calendar , you can use Caledarauto function which takes care of the dates automatically
I think you have separate Target  and I assume [TARGET_] is a measure

then you can use filter formula CALCULATE([TARGET_],filter(all(dates),dates[year]=2021))
LEt me know whether that works




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Paulyeo11
Impactful Individual
Impactful Individual

Hi Vijay

I try using your expression , i get error :-

Paulyeo11_1-1609684219013.png

 

 

LillyLegenda
Helper III
Helper III

Hi Paul, maybe you can do 

Date2 = CALENDAR(Date(2000,01,01),date(2021,12,31))

and use that for 2021.

Thank you Lilly

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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