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
Krijgersss
Helper I
Helper I

need help with a future calculation

i need some help to make a future calculation. for example in February i sold 28.000 in 28 days so for march the future calculation must say 31.000 because march has 31 days so 1000 x 31. this is a realy easy example but it shows what i want for a result.

i have a table with a date colum and a Revenu colum. in my model i have made a relation on date with a calender table. what kind of measure do i need to make this work i want to filter on month and year with a slicer.

many thanks 

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:
Data:

ValtteriN_0-1712133509075.png

 

Dax:

Act / forecast =
IF(MAX('Calendar'[Date])>TODAY(),

CALCULATE(
SUM('Table (31)'[Value]),DATEADD('Calendar'[Date],-1,MONTH)),
SUM('Table (31)'[Value]))




End result:

ValtteriN_1-1712133547493.png

 

Here we test for if date in fact is larger than today -> future value. Then we calculate a forecast. Here it is based on the value of previous month. So April and May are forecasts here. Here the logic is to simply take the previous months value, but the logic can be whatever. E.g. here the value is lastmonth's value times 2.

Act / forecast *2 =
IF(MAX('Calendar'[Date])>TODAY(),

CALCULATE(
SUM('Table (31)'[Value]),DATEADD('Calendar'[Date],-1,MONTH))*2,
SUM('Table (31)'[Value]))

ValtteriN_2-1712133711929.png

 


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




basicly i want the revenu of last month per day calculated on next month so for example february its 29,000 let say 1,000 per day than march will be 31,000 because february is 29days a 1,000 perday so my prognose/ future calculation will be 2 more days +1,000 is 31,000

Hi @Krijgersss ,

 

According to your statement, I think you want to forecast the sales based on last month sales.

I suggest you to try my workaround.

vrzhoumsft_1-1713769690723.png

Data model:

vrzhoumsft_0-1713769665988.png

Measure:

Days Count = CALCULATE(DISTINCTCOUNT('Calendar'[Date]))
Forecast Sales based on last month = 
CALCULATE(SUM('Table'[Sales]),PREVIOUSMONTH('Calendar'[Date])) / CALCULATE(DISTINCTCOUNT('Calendar'[Date]),PREVIOUSMONTH('Calendar'[Date])) * [Days Count]

Result is as below.

vrzhoumsft_2-1713769776690.png

 

Best Regards,
Rico Zhou

 

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.