Forum Discussion
Lookupvalue using dates?
- Anonymous7 years ago
Iamnvt wrote:
It looks like you are writing a Measure, not calculated column. I think you should turn off the date hierarchy to have [.Month] off.
You can go to Model tab, and insert calculated column with the said formula. Check my PBI file for more details.Just want to close the loop on the question and address the date hierarchy.
The date hierarchy has been off and still the .[Month] etc. comes up.
I ended up using:
Measure = Divide(sum('Table1'[Decimal]),calculate(sum('Table2'[Number])),0)which seems to work. TY
Iamnvt wrote:hi,
you can use calculated column:
Calculated Column % = DIVIDE(Table1[Decimal], LOOKUPVALUE(Table2[Number],Table2[Date],Table1[Date]))here is the PBI file:
https://1drv.ms/u/s!Aps8poidQa5zk6pa5KcbigH1gCmIYg
I took it back a step and tried just getting the "Lookupvalue" function to work.
Each time when I get to "Table2[Date] I get options for ".Date" ".Month" etc and after I chose one there is no option to pick "Table1[Date]" as my third attribute.
If I manually type over or copy and paste what you have above, I get this error:
"A single value for column 'Date' in table 'Table1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
Please let me know if you have any ideas on the error? TY.
You can go to Model tab, and insert calculated column with the said formula. Check my PBI file for more details.
- Anonymous7 years agoNot applicable
Iamnvt wrote:
It looks like you are writing a Measure, not calculated column. I think you should turn off the date hierarchy to have [.Month] off.
You can go to Model tab, and insert calculated column with the said formula. Check my PBI file for more details.Just want to close the loop on the question and address the date hierarchy.
The date hierarchy has been off and still the .[Month] etc. comes up.
I ended up using:
Measure = Divide(sum('Table1'[Decimal]),calculate(sum('Table2'[Number])),0)which seems to work. TY