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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

USERRELATOINSHIP with one inactive one active field?

Hi everyone, 

 

I have two tables (attached). One table has a list of VIPs and the other has a table of customer transactions (to, from and $ amount). I want to filter visualizers based on if the VIP was involved in the transaction as a "to" or a "from." Since the VIP id # occurs in both to and from fields I've made two relationships. You can guess the problem I run into when trying to summarize in a table view: I get a summary for whatever relationship is currently active.

 

My objective is to have a summary that summarizes for both fields filtered against the VIP list. I've toyed around with USERRELATIONSHIP arguments to no avail. Some screen shots below on sample data.

 

Sample VIP Table:

ethainos_0-1658943565461.png

 

Sample Transactions Table:

ethainos_4-1658943684530.png

Data Model:

ethainos_2-1658943633344.png

 

Output when to address active (left) and when from address active (right):

 

ethainos_5-1658943746705.png             ethainos_6-1658943785673.png

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
Barthel
Solution Sage
Solution Sage

Give this measure a try:

 

Total = 
VAR to_adress =
    CALCULATE (
        SUM ( Transactions[$ value] ),
        USERELATIONSHIP ( VIP[customerID], Transactions[to_adress] )
    )
VAR from_adress =
    CALCULATE (
        SUM ( Transactions[$ value] ),
        USERELATIONSHIP ( VIP[customerID], Transactions[from_adress] )
    )
RETURN
    to_adress + from_adress

View solution in original post

9 REPLIES 9
Barthel
Solution Sage
Solution Sage

Give this measure a try:

 

Total = 
VAR to_adress =
    CALCULATE (
        SUM ( Transactions[$ value] ),
        USERELATIONSHIP ( VIP[customerID], Transactions[to_adress] )
    )
VAR from_adress =
    CALCULATE (
        SUM ( Transactions[$ value] ),
        USERELATIONSHIP ( VIP[customerID], Transactions[from_adress] )
    )
RETURN
    to_adress + from_adress
Anonymous
Not applicable

Thanks @Barthel. I'm not as concerned with sum so much as I am the tables populating with each VIP. As you can tell from the screen shots, depending on which relationship is active, I get certain VIPs to appear in the table. I'd like them all to appear in the VIP[customer_id] column. Does that make sense or can I clarify further?

Anonymous
Not applicable

@Barthel tried to use the DAX you provided and got close (DAX TX Value), but seems like the problem still exists to some degree with (blanks). See below. I'd be happy to share the test file if that would help.

 

ethainos_1-1658948887047.png

 

 

The VIP table consists of 9 unique customer IDs. The transactions table consists of 18 unique customer IDs. The 9 IDs in the transaction table for which no match can be made are shown as '(Blank)' in the chart. Once you add all IDs to the VIP table that appear in the transaction table, '(Blank)' will disappear.

Anonymous
Not applicable

Ah, I see. @Barthel thank you so much for your help here. I really appreciate it along with your prompt responses. I hope you can help me with some other issues in the future as I build this out. Thanks again.

The reason you don't see all VIPs is because there is no relevant value for that customerID (it is blank). 

2, 4 & 7 have no 'to address' value and 1, 3, 5, 6, 8 & 9 have no 'from address' value. To show all VIPs you have to place either both measures on the matrix (or a total).

Barthel_0-1658947829789.png

Or you set that you would like to see the blank values. To do this, select the matrix, go to the format panel and click on the down arrow of the customerID column. Then select 'Show items with no data'.

Barthel_1-1658947962214.png

 

Does this help you further?

 

Anonymous
Not applicable

@Barthel Thanks, I think this might work. In the example I pasted above, I filtered to exclude the (blanks) in the bar chart. Unsure why the double count occurs?

tamerj1
Super User
Super User

Hi @Anonymous 
Did you try adding both values, the one with USRELATIONSHIP and the one without is in one measure using + sign?

Anonymous
Not applicable

thank you for the reply @tamerj1 (you were a life saved with my prior issue last week!!). I clarified a bit in my response to Barthel above. The purpose of this is not to create a single aggregation measure, but to have those items display across the table visualizations. Happy to clarify

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors