Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi Team,
I have a dataset of 3 columns a
s stated in the picture attached.
I want to do a simple vlookup of the second column in the entire range and want to return the result(Third column) as a new column.
I tried using the simple Lookupvalue dax but was unsuccessful.
Please help me out!
Thank you!
Solved! Go to Solution.
Yes, blank rows will also cause that issue with LOOKUPVALUE.
You can try something like...
Calculated Column 2 =
var _vTable =
SUMMARIZE(
'Table',
'Table'[Column1],
"_value", SUM('Table'[Column3])
)
var _result =
SUMX(
Filter(_vTable, [Column2] = [Column1]),
[_value]
)
Return
_result
Let me know how that works.
Proud to be a Super User! | |
That error is indicating that there are values in Column2 that appear more than once in Column1. If this is the case then LOOKUPVALUE will not work. You will need to decide how you are going to aggregate the data in Column3 and then use the appropriate function (SUM, AVERAGE etc.).
Proud to be a Super User! | |
I have cross checked the dataset there is only 1 matching value present in column 2 which is appearing in column 1. However there are a blank row. Is that causing the problem?
Also is there any other way in which I can solve this problem?
Yes, blank rows will also cause that issue with LOOKUPVALUE.
You can try something like...
Calculated Column 2 =
var _vTable =
SUMMARIZE(
'Table',
'Table'[Column1],
"_value", SUM('Table'[Column3])
)
var _result =
SUMX(
Filter(_vTable, [Column2] = [Column1]),
[_value]
)
Return
_result
Let me know how that works.
Proud to be a Super User! | |
Thanks it worked!
Using the example table...
| Column1 | Column2 | Column3 |
| AAA-BBB | AAA-BBB | 100 |
| ABC-DEF | ABC-FED | 50 |
| ABA-AAA | ACA-AAA | 75 |
| DAC-FED | DAC-FED | 250 |
You can use a calculated column...
Calculated Column =
LOOKUPVALUE('Table'[Column3],'Table'[Column1],[Column2])
To get the result...
Proud to be a Super User! | |
By doing this it's giving me the error " A table of multiple values was supplied where a single value was expected"
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |