Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Power BI community,
I hope everyone doing well. Currently I am working on a table which I need to add couple of columns from another table. I managed to retrieve one column based on filter context however I would like to learn if there is a way to retrieve multiple columns at the same time. Thanks to this community I found following DAX code which retrieves one column based on one or multiple filter context. The code below return students age, but I would like to retrieve grades, parent name etc. at the same time.
Solved! Go to Solution.
Hi @Anonymous ,
You could use lookupvalue function to realize it.
Syntax:
LOOKUPVALUE(
<result_columnName>,
<search_columnName>,
<search_value>
[, <search2_columnName>, <search2_value>]…
[, <alternateResult>]
)
Check here for more details.
Also check below blog for reference:
https://www.c-sharpcorner.com/article/dax-in-power-bi-how-to-use-lookupvalue-function/
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Hi @Anonymous ,
You could use lookupvalue function to realize it.
Syntax:
LOOKUPVALUE(
<result_columnName>,
<search_columnName>,
<search_value>
[, <search2_columnName>, <search2_value>]…
[, <alternateResult>]
)
Check here for more details.
Also check below blog for reference:
https://www.c-sharpcorner.com/article/dax-in-power-bi-how-to-use-lookupvalue-function/
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Thank you! Missed that functionality of Lookupvalue().
@Anonymous , In this case, better option is to merge in power query
Merge Tables (Power Query) : https://www.youtube.com/watch?v=zNrmbagO0Oo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=16
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
Or you need two create new columns for all those required columns.
If DAX we prefer dimensions to remain separate. So unless it is most required, you should avoid it.
Hello thanks a lot for your reply. However as the number of rows differ merge operation is not working. Only option seems to retrieve each column one by one for now.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |