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

Target line to accumulate until end of year

Hello,

 

I am working on a combo chart which shows the bars for each year selected and a line for current year target only. The bars are displayed based on selection as required, however, i am struggling with the target line. Both bar and line accumulate over months i.e., the values adds up across months as shown in the image below. As you can see the target line stops adding up after current month. I am using the below expression for Target and the fields used on the chart are as shown below.

DivyaAnand_0-1614233306700.png

DivyaAnand_1-1614233567737.png

 

CALCULATE(SUM(Target[Target]),
FILTER(Target, Target[Year]=2021), 
FILTER(Target, Target[MonthNum]<=MAX('Textron Calendar'[Calendar Month Number])))
 
How do i get the target line to add up until Dec 2021 inspite of not having tickets for >Feb 2021?
 

 

 

 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a measure with date table

 

YTD = CALCULATE(UM(Target[Target]),DATESYTD('Date'[Date],"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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.