Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello, I am attempting to write a Salary Forecast Report.
The simplified Data Table contains the following Fields
EmployeeID FYMonth FTESalary %Increase | Forecasted Salary
1 1 5000 0 5000
1 2 5000 0.03 5150
1 3 5000 0 5150
1 4 5000 0.02 5253
.......
2 1 1000 0 1000
2 2 1000 0.03 1030
2 3 1000 0 1030
2 4 1000 0.02 1050.60
......
I need to calculate the compounded Forecasted Salary above.
Any ideas on how to achieve this would be appreciated.
Solved! Go to Solution.
Hi @AndrewI ,
The following is derived from this blog:
Thanks @parry2k @Anonymous ,
After testing, natelpeterson's method gave the anticipated results.
I'm not sure why the second method is close but not correct.
So I did manage to make it work in Power BI by using the DAX code above but I'd still appreciate some help in order to make it work in Power Pivot. My problem though is slightly more complex as there might be cases that the initial salary / the base for each respective month, might not be the same across all the months as i might decide to promote a staff member. in that case the solution cannot work as if the timing of the increase is before the new salary calc then what the code is doing is compounding the new initial salary amount while it should not do it and for this month and onwards the salary should be the same unless at this point or later on there is a 2nd % increase in salary. so the question is how do we make the compounding reset back to 1 when the initial salary changes?
hmm..experimented a little bit more and manage to make it work with the SELECTEDVALUE() and definition of respective variables so that my criteria are met. Now, the question remains, how can we do the same in Power Pivot where the SELECTEDVALUE is not available ??
hi @AndrewI
any chance you could share a sample of this solution so that to uunderstand its logic and be able to apply in a similar problem? also, did you try to do the same in PQ/ Power Pivot in Excel?
Hi @AndrewI ,
The following is derived from this blog:
I am having a similar challenge but in my case the data is on Power Query in Excel where the SELECTEDVALUE() is not supported. Can you please tell me on how to do the same thing in Excel / PQ with another function and also explain the steps?
thank you in advance!
@AndrewI I didn't tested the solution but let's try this.
first add measure to calculate cummulative % increase
Increase **bleep** = VAR x = CALCULATE( SUM( Table6[Increase] ),FILTER( ALLEXCEPT( Table6, Table6[Employee] ), Table6[Month] <= MAX( Table6[Month] ) ) ) VAR y = CALCULATE( SUM( Table6[Increase] ) ) VAR z = CALCULATE( SUM( Table6[Increase] ),FILTER( ALLEXCEPT( Table6, Table6[Employee] ), Table6[Month] < MAX( Table6[Month] ) ) ) RETURN x + (z * y)
now multiply this with salary to get forecast salary
Forecast Salary = VAR s = SUM( Table6[Salary] ) RETURN (s*[Increase **bleep**]) + s
and it should work.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
88 | |
83 | |
64 | |
49 |
User | Count |
---|---|
127 | |
108 | |
87 | |
70 | |
66 |