cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BeatNick Frequent Visitor
Frequent Visitor

Forecast Growth with PRODUCTX()

I'm trying to forecast based off a variable growth rate built from a "What if" parameter. I've been following this helpful blog Recursive Calculation in Power BI and I've gotten to the final steps and can't seem to get the caculation right

Here is a snapshot of the blog's final excel table based on sales and what I'm trying to mimic. Sales is forcasted out by using the desired growth rates in the final column with ProductX()

SalesCorrect.png


I've translated his formulas and got the following results:
ExistingIssue.png
All my values seem to line up nicely (last membership caculating correctly, mutiplyby using correct growth rate) but the final forecast fails to caculate and I've been pulling out my hair trying to spot the issue in my DAX. Here are my translated forumlas

LastMembership:

LastMembership = 
IF(
    ISBLANK(CALCULATE(COUNTROWS(FactMembership), DATEADD(DimDate[Date], 1, MONTH))), 
    COUNTROWS((FactMembership)), 
    1
)


MultiplyBy:

MultiplyBy = IF(ISBLANK([LastMembership]), 1+[GrowthRate Value], [LastMembership]) 


Final forecast Calc:

ForecastMembership = 
IF(ISBLANK([TotalMembers]), 
    CALCULATE(
        PRODUCTX(VALUES(DimDate[Month]), [MultiplyBy]), DATESBETWEEN(DimDate[Date], BLANK(), MAX(DimDate[Date]))
    ), 
    [TotalMembers]
)


Can anyone spot where I went wrong?

3 REPLIES 3
Community Support Team
Community Support Team

Re: Forecast Growth with PRODUCTX()

Hi @BeatNick ,

 

By my test, you need to modify the measure “LastMembership”. The following is my sample you can reference, then to modify yours.

 

I have three tables. Table DimDate is a calendar table.  There is a many-to-one relationship between table FactMembership and table DimDate.

 

DimDate = CALENDARAUTO()

Month = MONTH(DimDate[Date])

0.png00.jpg

 

Note : Create the measure LastMembership using SUM function, not COUNTROWS function.

LastMembership =

IF(

    ISBLANK(CALCULATE(SUM(FactMembership[Members]), DATEADD(DimDate[Date], 1, MONTH))),

    SUM(FactMembership[Members]),

    1

)

GrowthRate Value = CALCULATE(VALUES(ExpectedGrowth[ExpectedGrowth]), LASTDATE(ExpectedGrowth[Month]))

 

MultiplyBy = IF(ISBLANK([LastMembership]), 1+[GrowthRate Value], [LastMembership])

 

TotalMembers = SUM(FactMembership[Members])

 

ForecastMembership =

IF(ISBLANK(FactMembership[TotalMembers]),

    CALCULATE(

        PRODUCTX(VALUES(DimDate[Month]), [MultiplyBy]), DATESBETWEEN(DimDate[Date], BLANK(), MAX(DimDate[Date]))

    ),

    [TotalMembers]

)

1.png

 

Best Regards,

Xue Ding

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

BeatNick Frequent Visitor
Frequent Visitor

Re: Forecast Growth with PRODUCTX()

Thanks for the in-depth reply! Sadly, that doesn't seem to be the issue. My FactMembership table is a snapshot of my company's membership on a monthly basis where each row is a person and frozen at the end of each month. I can't really sum up the rows but I got around this by adding a caculated column called "members" that just equals 1 and summed that:

LastMembership = 
IF(
    ISBLANK(CALCULATE(SUM(FactMembership[Members]), DATEADD(DimDate[Date], 1, MONTH))), 
    SUM(FactMembership[Members]), 
    1
)

 I've had problems before with time based functions before so I decided to re-create your setup as closely as possible and ended up with this data model using CALENDARAUTO().

 

DataModel.png

 

Sadly I end up with the same issue with all formulas unchanged except for TotalMembers and LastMembership which I switched to SUM():
new_chart.png

Let me know if you can think of anything else. Thanks @v-xuding-msft 

BeatNick Frequent Visitor
Frequent Visitor

Re: Forecast Growth with PRODUCTX()

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 150 members 1,748 guests
Please welcome our newest community members: