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
Devesh
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]))

I really appreciate any help you can provide.

Devesh_0-1626354040408.png

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
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]
)

vkkfmsft_0-1626674309745.png

 

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.

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Devesh ,

 

Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

 

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

v-kkf-msft
Community Support
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]
)

vkkfmsft_0-1626674309745.png

 

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.

 

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.