cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Create a cumulative projected line for the month using average of previous days in the same month.

Hi guys,

I have been struggling to solve a simple problem for a few days now. I want a projected line based on the average of previous days sales. (As shown in the picture)

Projected Revenue = ([Sales]/DAY(TODAY())*DAY(EOMONTH(TODAY(),0))

The Green line is the actual sales, and I want a line to project the sales using the above formula.
I have calculated actual sales using this formula:

Cumulative Actual =
Var LNBD = LASTNONBLANK(Datemaster[Date],[Sales])
RETURN
CALCULATE([Sales],FILTER(ALL(Datemaster[Date]), Datemaster[Date] <= LNBD),GROUPBY(Datemaster,Datemaster[Month Name]))

1 ACCEPTED SOLUTION
Community Support

Hi @Devesh ,

Try the following formula:

``````Measure =
IF(
MAX(Datemaster[Date]) > LASTNONBLANK( Datemaster[Date], [SumSales] ),
AVERAGEX( ALLSELECTED(Datemaster[Date]), [SumSales] ) * DAY( MAX(Datemaster[Date]) ),
[Cumulative Actual]
)``````

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Community Support

Hi @Devesh ,

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

Community Support

Hi @Devesh ,

Try the following formula:

``````Measure =
IF(
MAX(Datemaster[Date]) > LASTNONBLANK( Datemaster[Date], [SumSales] ),
AVERAGEX( ALLSELECTED(Datemaster[Date]), [SumSales] ) * DAY( MAX(Datemaster[Date]) ),
[Cumulative Actual]
)``````

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### 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.