cancel
Showing results forĀ
Did you mean:Ā

## Calculate a forcast using a measure in another measure

I have created a monthly index to calculate the last 6 months and a corresponding calculation for the same period last year.

Now I want to use this % as a factor. I want the development  to be constant for the whole 6 months even if I choose to show a graph with sales divided by months.

How can I make this percentage to be 7.86% in this case, although I want to show a graph development of actual sales per month

My goal is to make a forecast based on a (average of the last 2 years) * development last 6 months

Sales forecast =
VAR
VAR
VAR
Factor=1+(Table - 58248'[UTVIKLLING siste 6 mnd i %])
RETURN
divide(Salesly+SalesLY3,2,0)*Factor

SALE LAST 6 months is calculated like this:
Sale last 6 m = SUMX(
CALCULATETABLE(
'DATO',
'DATO'[Last6Months] = 1
),
[Salg totalt]
)

I find last 6 months like this in my date table:
Last6Months =
VAR TodayMonthIndex =
CALCULATE (
MAX ( 'DATO'[MonthIndex] ),
FILTER ( 'DATO', TODAY () = 'DATO'[Date] )
)

VAR monthtocheck = 'DATO'[MonthIndex]

RETURN
IF (
AND ( monthtocheck >= TodayMonthIndex - 6, monthtocheck < TodayMonthIndex ),
1,
0
)
1 ACCEPTED SOLUTION

Accepted Solutions

Here I thought to advanced. It is solved simply by sum a column that has a value based on a If formula.

2 REPLIES 2

Hi, @oletho ;

Please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Here I thought to advanced. It is solved simply by sum a column that has a value based on a If formula.

Announcements

#### Back to Basics Tuesday Tip #9: All About the Galleries

This is theĀ ninthĀ post inĀ our seriesĀ dedicated to helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we feature new content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other! Ā  Ā  Today's Tip: All About the Galleries Have you checked out the library of content in our galleries? Whether you're looking for the latest info on an upcoming event, a helpful webinar, or tips and tricks from some of our most experienced community members, our galleries are full of the latest and greatest video content for the Power Platform communities. Ā  There are several different galleries in each community, but we recommend checking these out first: Ā  Community Connections & How-To Videos Hosted by members of the Power Platform Community EngagementĀ  Team and featuring community members from around the world, these helpful videos are a great way to "kick the tires" of Power Platform and find out more about your fellow community members! Check them out in Power Apps, Power Automate, Power Pages, and Copilot Studio! Ā  Ā  Ā  Ā  Webinars & Video Gallery Each community has its own unique webinars and videos highlighting some of the great work being done across the Power Platform. Watch tutorials and demos by Microsoft staff, partners, and community gurus! Check them out: Power Apps Webinars & Video Gallery Power Automate Webinars & Video Gallery Power Pages Webinars & Video Gallery Copilot Studio Webinars & Video Gallery Ā  Events Whether it's the excitement of the Microsoft Power Platform Conference, a local event near you, or one of the many other in-person and virtual connection opportunities around the world, this is the place to find out more about all the Power Platform-centered events. Power Apps Events Power Automate Events Power Pages Events Copilot Studio Events Ā  Unique Galleries to Each Community Because each area of Power Platform has its own unique features and benefits, there are areas of the galleries dedicated specifically to videos about that product. Whether it's Power Apps samples from the community or the Power Automate Cookbook highlighting unique flows, the Bot Sharing Gallery in Copilot Studio or Front-End Code Samples in Power Pages, there's a gallery for you! Ā  Check out each community's gallery today! Power Apps Gallery Power Automate Gallery Power Pages Gallery Copilot Studio Gallery