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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
samueldegrace
New Member

Table and relationships

Hello, 

 

I'm having a hard time trying to find a solution to a problem. I created a table that looks a like this: 

2017-08-28 15_38_24-DashboardCTB - Power BI Desktop.png

 

 

 

 

Now, I only want to show rows where [Montant] is higher than [Budget]. The problem is, this data comes from two other tables, like this: 

2017-08-28 15_40_59-DashboardCTB - Power BI Desktop.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[Montant] comes from CHARTE and [Budget] from BUDGET. I tought of creating a column in the Master table that shows 1 or 0 depending of if I bust the budget or not and filtering on that, since it's this table (Master) that I use for the table in the first picture, but the RELATED function only works in a many-to-one relationship, and I have the oposite. As a result, I can't use a syntax like this:

 

Bust = IF(RELATED(CHARTE[Montant] > RELATED(BUDGET[Budget], 1, 0)

 

I searched alot online, but no luck. Any ideas would be realy appreciated. 

 

Thank you! 

2 ACCEPTED SOLUTIONS
richbenmintz
Resident Rockstar
Resident Rockstar

You can create a measure that looks to see if the montant > budget

test measure = if(sum(montant) > sum(budget), true(), false())

 

you can then add this measure to your visual filters use it to filter the data. 

or you can set montant to blank() if the budget is greater

like montant = if(sum(montant) > sum(budget), sum(montant), blank())

and then filter the visual to only show rows with non blank Montant values.

 

Hope that helps,

 

Richard



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

TomMartens
Super User
Super User

Hey,

 

maybe you can try the RELATEDTABLE() used in a CALCULATE() like so

Bust = 
IF(CALCULATE(SUM('CHARTE'[Montant]), RELATEDTABLE('CHARTE')) >
CALCULATE(SUM('BUDGET'[Budget]), RELATEDTABLE('BUDGET')),1,0)

RELATEDTABLE() is the opposite from RELATED. RELATETABLE pulls from the many side, for this reason it is necessary to provide an aggregate function.

 

Hope this helps

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

maybe you can try the RELATEDTABLE() used in a CALCULATE() like so

Bust = 
IF(CALCULATE(SUM('CHARTE'[Montant]), RELATEDTABLE('CHARTE')) >
CALCULATE(SUM('BUDGET'[Budget]), RELATEDTABLE('BUDGET')),1,0)

RELATEDTABLE() is the opposite from RELATED. RELATETABLE pulls from the many side, for this reason it is necessary to provide an aggregate function.

 

Hope this helps

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
richbenmintz
Resident Rockstar
Resident Rockstar

You can create a measure that looks to see if the montant > budget

test measure = if(sum(montant) > sum(budget), true(), false())

 

you can then add this measure to your visual filters use it to filter the data. 

or you can set montant to blank() if the budget is greater

like montant = if(sum(montant) > sum(budget), sum(montant), blank())

and then filter the visual to only show rows with non blank Montant values.

 

Hope that helps,

 

Richard



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.