The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello.
I am creating Inventory Table mixing real data for the past days and predicted data for the future days. I have these 3 tables:
https://docs.google.com/spreadsheets/d/1NHSx1a4oN7X3hYK39o39RcaKuhZjYkLkh2OtDvnKx3o/edit#gid=0
Inventory Table Column Formulas are:
Solved! Go to Solution.
@v-lili6-msft Sorry I forgot to open the spreadsheet. However I have already found the solution
Sf = VAR Sf = LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], MAX(PASTINVENTORY[Date]), PASTINVENTORY[Product], inventory[productId])
var curdate = inventory[date]
var lastdate1 = MAX(PASTINVENTORY[Date])
var io = CALCULATE(SUM(inventory[income])-SUM(inventory[outcome]),FILTER(ALL(inventory),AND(inventory[date] <= curdate,inventory[date] >= lastdate1)))
var a = IF(inventory[date]<TODAY(), LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], inventory[date], PASTINVENTORY[Product], inventory[productId]), Sf+io)
RETURN a
hi @aramirez2
The file you uploaded needs permission, please upload again.
and you could also have a look this blog:
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Regards,
Lin
@v-lili6-msft Sorry I forgot to open the spreadsheet. However I have already found the solution
Sf = VAR Sf = LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], MAX(PASTINVENTORY[Date]), PASTINVENTORY[Product], inventory[productId])
var curdate = inventory[date]
var lastdate1 = MAX(PASTINVENTORY[Date])
var io = CALCULATE(SUM(inventory[income])-SUM(inventory[outcome]),FILTER(ALL(inventory),AND(inventory[date] <= curdate,inventory[date] >= lastdate1)))
var a = IF(inventory[date]<TODAY(), LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], inventory[date], PASTINVENTORY[Product], inventory[productId]), Sf+io)
RETURN a
@aramirez2 - Perhaps have a look at Days of Supply - https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656#M318
Thanks @Greg_Deckler for your answer. It is a great exercise even though it is not very related to my issue.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
137 | |
106 | |
103 | |
73 | |
59 |
User | Count |
---|---|
266 | |
127 | |
119 | |
100 | |
88 |