Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Guys,
I have 2 tables.
Table 1:
User ID Shift
Table 2 :
USer ID
How do I add a shift column in table 2 with respect to each user ID's in Table 1?
THanks,
Anand!
Solved! Go to Solution.
Hi, @Anonymous ,
not much information you are providing here, so not possible to narrow down what would be the best approach for you.
If you have a relationship between the tables, you can look into the related-function, as long as it only returns one value.
Or you can use the lookupvalue-function
Or you can use something like this
column =
VAR _u2 =
CALCULATE ( SELECTEDVALUE ( 'Table2'[UserID] ) )
RETURN
CALCULATE (
MAX ( 'Table1'[Shift] );
FILTER ( ALL ( 'Table2' ); _u2 = 'Table1'[UserID] )
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi @Anonymous ,
Could you please share your sample data and excepted result to me if you don't have any confidential Information. Please upload your files to One Drive and share the link here. I am not clear about your data type, it is difficult to give a correct solution.
Hi, @Anonymous ,
not much information you are providing here, so not possible to narrow down what would be the best approach for you.
If you have a relationship between the tables, you can look into the related-function, as long as it only returns one value.
Or you can use the lookupvalue-function
Or you can use something like this
column =
VAR _u2 =
CALCULATE ( SELECTEDVALUE ( 'Table2'[UserID] ) )
RETURN
CALCULATE (
MAX ( 'Table1'[Shift] );
FILTER ( ALL ( 'Table2' ); _u2 = 'Table1'[UserID] )
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
User | Count |
---|---|
98 | |
76 | |
74 | |
49 | |
26 |