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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Cumulative Line Target in Chart

I am tying to make a cumulative line target appear in the chart. The line must start with the value given by the measure and then it gets added by itself for each day. For example: if the target value in the first day is 5, for second day will be 10, the third will 15, and so on... 

 

Here is the measure that I am currently using:

 

Cumulative_Target =
CALCULATE(
SUM(Meta_Comp_Alim[Meta_Alim_Diaria]),
FILTER(
ALLSELECTED(Date_Table),
Date_Table[Date_Column] <= MAX(Date_Table[Date_Column])
)
)
 
The above measure will always give a constant value (because the table has values for the first day only)
AllaRN_0-1657638909836.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Make sure the start measure always returns static value for each day.

Then rank the days on x-axis and multiply by [measure].

Cumulative_Target = [Measure]*RANKX(ALLSELECTED(Date_Table),CALCULATE(SELECTEDVALUE(Date_Table[day])),,ASC)

vjaywmsft_0-1657853564500.png

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Make sure the start measure always returns static value for each day.

Then rank the days on x-axis and multiply by [measure].

Cumulative_Target = [Measure]*RANKX(ALLSELECTED(Date_Table),CALCULATE(SELECTEDVALUE(Date_Table[day])),,ASC)

vjaywmsft_0-1657853564500.png

 

Best Regards,

Jay

claymcooper
Resolver II
Resolver II

Hi @Anonymous,
Is the x-axis in your chart equal to Date_Table[Date_Column]? If not, try changing your calculation to:

Cumulative_Target =
CALCULATE(
SUM(Meta_Comp_Alim[Meta_Alim_Diaria]),
FILTER(
ALLSELECTED(Date_Table),
**x-axis value** <= MAX(**x-axis value**)
)
)

Hope this helps!
Anonymous
Not applicable

Thank you for your reply @claymcooper  .

The x-axis in the chart is not equal to Date_Table[Date_Column], but it's from the same table. Your suggestion won't work.

 

AllaRN_0-1657648237013.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.