Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
YonghunLee
Helper I
Helper I

How to get User Info

I want to make sale view from Sale Table and User Table

As you can see, Sale Table can refer to User Table for User Name with ID

To do that, what should I do?

 

11.png

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @YonghunLee ,

You can create one calculated column in table Sale as below, please find the details in this sample PBIX file. The precondition is creating the relationship between Sale(Buyer_ID) and user(UserID).

How to get User Info.JPG

 

Seller =
VAR s = 'Sale'[Seller_ID]
VAR n =
    CALCULATE ( MAX ( 'User'[Name] ), FILTER ( 'User', 'User'[UserID] = s ) )
RETURN
    n
 

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @YonghunLee ,

You can create one calculated column in table Sale as below, please find the details in this sample PBIX file. The precondition is creating the relationship between Sale(Buyer_ID) and user(UserID).

How to get User Info.JPG

 

Seller =
VAR s = 'Sale'[Seller_ID]
VAR n =
    CALCULATE ( MAX ( 'User'[Name] ), FILTER ( 'User', 'User'[UserID] = s ) )
RETURN
    n
 

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@YonghunLee 

You can join it with both columns and you will get one active and one inactive join. You can use that in the formula(using userelation) to active. But in this case, it might work out. Still refer example

 

You can create one more version of this table and use

Buyer Table = user table

Or

Buyer Table = summarize (user table , user table[Userid],user table [name])

 

Or you can populate name is sales table like this

 

seller_name = minx(filter('Sales Table','Sales Table'[seller_id]='User table'[UserID]),'User table'[Name])

buyer_name = minx(filter('Sales Table','Sales Table'[buyer_id]='User table'[UserID]),'User table'[Name])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.