Forum Discussion
Changing from Today to specific Date
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)?
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
1 Reply
- Greg_Deckler
Community Champion
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