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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Force indirect relationship in dax?

I have the below model:

 

ovonel_0-1631617992588.png

 

 

 

 

 

ovonel_1-1631618018224.png

 

 

And when I want to display revenue by segment, it just gives me the totals:

ovonel_2-1631618069949.png

 

(The above is wrong; it should roughly be half for A and half for B, but it just displays totals 3 times...)

 

Is there a function in dax I have to use to enforce this segmentation?? (the segmentation comes from ClientType, which is not directly related, but through Client.

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

@Anonymous You could try:

 

 

CALCULATE(
  SUM('Revenue'[Revenue]),
  TREATAS(DISTINCT('ClientType'[ClientNo]),'Client'[ClientNo])
)

 

 

How many records are in each table? Also, the relationships shown in your image seem to be impossible. You have multiple paths between the Client table and the Revenue table and so there is a relationship that would need to be inactive.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

thanks for your answer, unfortunately I get:

ovonel_0-1631622437016.png

 

@Anonymous You could try:

 

 

CALCULATE(
  SUM('Revenue'[Revenue]),
  TREATAS(DISTINCT('ClientType'[ClientNo]),'Client'[ClientNo])
)

 

 

How many records are in each table? Also, the relationships shown in your image seem to be impossible. You have multiple paths between the Client table and the Revenue table and so there is a relationship that would need to be inactive.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Well, you could use a technique I call DAX Table Hopping:

Measure = 
  VAR __Clients = DISTINCT('ClientType'[ClientNo])
  VAR __KeyCustomers = DISTINCT(SELECTCOLUMNS(FILTER('Client',[ClientNo] IN __Clients),"__Key_Customer",[Key_Customer]))
RETURN
  SUMX(FILTER('Revenue',[Key_Customer] IN __KeyCustomers),[Revenue])

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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