Forum Discussion
MojoGene
Post Patron
10 years agoLOOKUPVALUE help
I am attempting to determine timekeeper net profit by subtracting the timekeeper's costs from the value of the timekeeper's work. There is a table, 'TimeTable', that contains columns for [Timekee...
- 10 years ago
MojoGene These are the Measures I used ....
YTD Value = TOTALYTD(SUM(TimeTable[Hourly Value]), CalendarTable[Date]) YTD Cost = SUM(Costs[Total Comp])*YEARFRAC(STARTOFYEAR(CalendarTable[Date]), TODAY(),3) YTD P/L = [YTD Value] - [YTD Cost] YTD P/L % = DIVIDE([YTD P/L], [YTD Cost], 0)
Here's the sample I created and the result... Hope this helps!
mike_honey
Memorable Member
10 years agoI think it's best to avoid LOOKUPVALUE in Measures - it works better in Calculated Columns.
I would add a Relationship between TimeTable and Costs (on TimeKeeper) and between TimeTable and DimDate (assuming TimeTable has a Date/DateKey column).
Then the measure would look something like:
YTD Profit = SUM(TimeTable[YTD Value]) - ( SUM(Costs[TotalComp ] * SUM ( DimDate[Calendar Year Fraction] ) )