Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hello,
I'm new here and just beginning with Dax. I currently have formula that works well, but I'm having to make some adjustments to work with a test file. The test file data ends on January 18, 2018. Here is the formula:
Average Days to Sell = divide([Inventory Valuation (Today)],[Last 365 Days COGS Amount]) * 365
How would I write this to work with the final day being January 18, 2018 instead of (Today)?
Solved! Go to Solution.
Perhaps:
Measure =
VAR __Max = MAX('Table'[Date])
VAR __Value = LOOKUP('Table'[Inventory Value],'Table'[Date],__Max)
RETURN
divide(__Value),[Last 365 Days COGS Amount]) * 365
Difficult to be sure, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Perhaps:
Measure =
VAR __Max = MAX('Table'[Date])
VAR __Value = LOOKUP('Table'[Inventory Value],'Table'[Date],__Max)
RETURN
divide(__Value),[Last 365 Days COGS Amount]) * 365
Difficult to be sure, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |