Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi Is there a way to do a calucation whereby i can add my previous day value to my current day calculation?
eg. previous day closing stock + opening stock current day =
Thanks
Solved! Go to Solution.
Hi @mohamedh,
Of course, you should lookup the previous day first, then calcualte it using calculated column.
I create sample data table.
Create a column ranked by date, then lookup the previous day value based on the rank colculated column.
Rank = RANKX(Test,Test[Date],,ASC) previous day closing value = LOOKUPVALUE(Test[closing stock],Test[Rank],Test[Rank]-1)
Finally add the current day value and previous day value together. Please see the formula and screenshot below.
previous-day-closing+opening-stock-current-day = Test[closing stock]+Test[previous day closing value]
If you have other issues, don't hesitate to let me know.
Best Regards,
Angelia
Hi @mohamedh
The link
http://blog.gbrueckl.at/2015/04/recursive-calculations-powerpivot-dax/
may be helpful. Check it out. If it solves your issue please give KUDOS.
Cheers
CheenuSing
Hi @mohamedh
The link
http://blog.gbrueckl.at/2015/04/recursive-calculations-powerpivot-dax/
may be helpful. Check it out. If it solves your issue please give KUDOS.
Cheers
CheenuSing
Hi @mohamedh,
Of course, you should lookup the previous day first, then calcualte it using calculated column.
I create sample data table.
Create a column ranked by date, then lookup the previous day value based on the rank colculated column.
Rank = RANKX(Test,Test[Date],,ASC) previous day closing value = LOOKUPVALUE(Test[closing stock],Test[Rank],Test[Rank]-1)
Finally add the current day value and previous day value together. Please see the formula and screenshot below.
previous-day-closing+opening-stock-current-day = Test[closing stock]+Test[previous day closing value]
If you have other issues, don't hesitate to let me know.
Best Regards,
Angelia
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 69 | |
| 39 | |
| 35 | |
| 23 |