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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
renatopnovaes
Helper I
Helper I

Sales forecast according to the accumulated so far

I'm putting together a sales forecast. I want to take the accumulated sales up to the moment of the month and divide by the number of working days executed and then multiply by the number of working days missing within the same month. I set up a calendar table with the working days of the month(In this base I mark 1 for working day and 0 for non working day in the WORKING DAYS column fields). The problem is that my database also has data from previous months. Then I'm trying to get the last update date, with it I'll know what month I want to act. I am using the measure
last update =MAX(baseCSV[data]) or last update =LASTDATE(baseCSV[data])

renatopnovaes_3-1622763768027.png

to find the last update of my database which is updated daily. With this function I find the last day and month I want to make the forecast. So I used the measure forecast month = MONTH(last update)

renatopnovaes_4-1622763829683.png

and forecast year=YEAR(last update) I found the month and year I want to calculate. So I tried to calculate how many working days I have within that month with CALCULATE. business day month = CALCULATE(SUM(dCalendar[working days]), dCalendar[number month]=[forecast month]),  dCalendar[year]=[forecast year]) and did not work. Can someone help me? I intend to reach this target below.

 

renatopnovaes_0-1622763405374.png

 




2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Could you please provide some sample data and expected results based on this?

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

Ashish_Mathur
Super User
Super User

Hi,

To your Table/matrix visual, drag Year and Month name from the Calendar Table and write this measure

Work days = sum(dcalendar[working days])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.