Skip to main content
cancel
Showing results for 
Search instead 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

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
Europe Fabric Conference

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.