Forum Discussion
Need assistance with LookupValues
- 9 years ago
Another Way using your tables sample:
ValuesFromTable2 = IF ( HASONEVALUE ( Table1[Country] ), AVERAGEX ( SUMMARIZE ( Table2, Table2[Country], "Values", CALCULATE ( SUM ( Table2[Values] ), FILTER ( Table2, Table2[Country] = VALUES ( Table1[Country] ) ) ) ), [Values] ), CALCULATE ( SUM ( Table2[Values] ) ) )
Hmmm---Both Options work, I just cant get numbers to calculate correctly.
Ill need to send this to you offline, This report is a huge pain. I developed it easily in SSRS , but Power BI makes simple things soo complicated. Maybee its the language as SQL is extreemly easy to understand, I find thi language almost impossible to understand.
Thanks!!! and Ill send you details soon on this report. It is a Very complex report and requires many calculations. Hopefully it wont be that bad since you are an expert at DAX.
Hi lcasey,
Lookupvalue syntax
LOOKUPVALUE( <result_columnName>, <search_columnName>, <search_value>[, <search_columnName>, <search_value>]…)
So you can use the DAX below to create a calculated column.
Column = LOOKUPVALUE(Table1[Amount],Table1[Country],Table2[Country])
Regards,
Charlie Liao