Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi. New to Power BI and would appreciate any advice and guidance on this.
I am trying to lookup the Buy User Ids in Table 1 in Table 2 and if the Buy User ID is in Table 1 matches the Sell User ID in Table 2 then net the Amounts and gives the "Exp Results" in Table 1.
Solved! Go to Solution.
HI, @Hayashi123
your information is not appropriate but try below
first make sure sellerid and user id tables is connected with eachother
and use below code for new column
Column =
var a = LOOKUPVALUE(seller[amount],seller[sellerid],user[userid])
return
user[amount]-a
HI @Hayashi123,
Perhaps you can try to use the IN operator to compare the selected value and calculate with current values.
Measure formula sample :
formula =
VAR currAmount =
SUM ( User[amount] )
VAR selected =
CALCULATE (
SUM ( Seller[Amount] ),
FILTER ( ALLSELECTED ( Seller ), [User ID] IN VALUES ( User[User ID] ) )
)
RETURN
currAmount - selected
The IN operator in DAX - SQLBI
Regards,
Xiaoxin Sheng
HI, @Hayashi123
your information is not appropriate but try below
first make sure sellerid and user id tables is connected with eachother
and use below code for new column
Column =
var a = LOOKUPVALUE(seller[amount],seller[sellerid],user[userid])
return
user[amount]-a
Thank you for your reply. It worked however, I wanted to do a sum lookup. So in the Seller table there could be multiple rows with a Seller User ID and varying amounts.
HI @Hayashi123,
Perhaps you can try to use the IN operator to compare the selected value and calculate with current values.
Measure formula sample :
formula =
VAR currAmount =
SUM ( User[amount] )
VAR selected =
CALCULATE (
SUM ( Seller[Amount] ),
FILTER ( ALLSELECTED ( Seller ), [User ID] IN VALUES ( User[User ID] ) )
)
RETURN
currAmount - selected
The IN operator in DAX - SQLBI
Regards,
Xiaoxin Sheng
hi @Hayashi123
I think you need provide more context because I cannot understand the logic of expected results. But if you would like to lookup you will have 2 options:
1. Create one to one relationship between buer and seller - my assumtions is they have 1-1 relationship based on your case. Then you can create either create measure that will calculate lookup value or create column in your table A with RELATED formula
2. Use merge operation in Power Query to join two datasets and name new column as Exp Results.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: www.linkedin.com/in/lukasz-kozdron
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |