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

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.

Reply
Anonymous
Not applicable

Userelationship to return specific text/value

Hi there, 

 

Got some great help with a prior post where the foundational issue is very similar. The main difference between the two (I believe) is the desired output here is a Text field whereas prior it was the summation of a value field. To paraphrase from my prior post:

 

I have two tables (attached). One table has a list of VIPs [customerID]'s and the other has a table of customer transactions. I intend to build a "schedule" of transactions based on the day the transaction occured. While it might seem somewhat redundant based on the small test case provided, I'd like to include in the schedule a column for my VIP IDs alongside the date, the to address and the from address.  

 

Since the VIP id # occurs in both to and from fields I've made two relationships in my data model. As expected, when I go to make a table visual the VIP[customerID] is only shown for whatever the active relationship is across the schedule, but shows as blank where the inactive relationship exists. I'd love some guidance on how to get the VIP[customerID] to show up across all transactions only where they occur in the to or from columns (e.g., if neither the to or from contain a VIP I'd like to exclude those from the table visual). Supporting data is below. I've tried primarily IF statements based off max(customerID) paired with userelationships and well as some variable runs to return max of customerIDs in both relationship states, but no success. Any help would be grateful.

 

VIP Table

ethainos_0-1661392911437.png

 

Transaction Table

ethainos_1-1661392973065.png

 

Data Model (link between ID and to/from)

ethainos_2-1661393025226.png

 

Table Visual (with missing customerIDs)

ethainos_3-1661393056676.png

 

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , How is the second measure created?

 

count from address = calculate(count(Table[From Address]), userelationship(VIP[Address], Table[From Address]))

 

if you are using not summarized From Address, then that is not a use case for userelationship. you need two dimension tables

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thanks! Have not created a measures in this case. Just a log of transactions. In the table I've simply added those fields outlined. Ideally, the customerID column would have no blanks in it, but given the active/inactive relationships they do. Does that make sense?

@Anonymous , You can make inactive as active using a measure only.

Blank can be because of that of missing values in VIP Table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak I think that's what I'm looking for... a measure to populate the customerID column. The customerID column is blank in some places because of the inactive/active relationship. For instance, if you look at the first row customerID 9 is in the VIP table, but yet not populated in the customerID column. Some things I've tried are below:

 

New Customer ID = //this measurement is needed to address the active/inactive relationship pair in our whales_lookup table to transfers table
    VAR to_address = 
        CALCULATE(
            Max(VIP[customerID]),
                USERELATIONSHIP(VIP[customerID],transactions[to_address]) // this creates a temporary and simultaneous active relationship between whales and to address
        )
    VAR from_address = 
        CALCULATE(
            Max(VIP[customerID]),
            USERELATIONSHIP(VIP[customerID],transactions[from_address]) // this creates a temporary and simultaneous active relationship between whales and from address
        )
        RETURN

        max(to_address, from_address)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.