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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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!:
Power BI Cookbook Third Edition (Color)

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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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