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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Alternative to bidirectional relationship

So I have these table relationships as below.

Iver199_0-1645448646060.png

 

Basically I want to filter to show Sales per Venue but I have no way of connecting Sales table to Venue table so it has to go through the Users table. Issue is that I have to make the relationship between Users and Calls table bidirectional otherwise it would show incorrect results. But the problem is that in my real report it is not an option for me to make the relationship bidirectional as it would conflict with other tables. Is there any DAX query I can use to filter Sales per Venue?

 

PBIX FILE

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

The simplest applicaiton of expanded table,

Sales by Venue = CALCULATE(SUM(Sales[Sales]),Calls)

CNENFRNL_0-1645459074321.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

The simplest applicaiton of expanded table,

Sales by Venue = CALCULATE(SUM(Sales[Sales]),Calls)

CNENFRNL_0-1645459074321.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

jdbuchanan71
Super User
Super User

@Anonymous 

You could also do it with a measure like this.

 

Sales by Venue = 
CALCULATE ( 
    SUM ( Sales[Sales] ),
    CROSSFILTER ( Calls[Username], Users[Username], BOTH )
)

 

jdbuchanan71_0-1645450976125.png

This measure will also work for showing amounts by name for example.  It just makes the relationship between Calls and Users bi-directional when it is calculating rather than you having to set it that way in the model.

jdbuchanan71_1-1645451104841.png

 

 

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 


var _tab = summarize(allselected(Call), Call[username]) // or// summarize(filter(allselected(Call), Venue[Venue] in allselected(Venue[Venue])), Call[username])
return
calculate(sum(sales[sales]), filter(users,users[username] in _tab))

 

 

also treatas, check https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.