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
setis
Post Partisan
Post Partisan

Ignoring a relationship

Dear experts, 

In the following data model

rel.PNG

 

I am trying to calculate some costs in G_L that do not have a Case ID. I need to ignore the relationship between G_L and Cases. 

 

The G_L table is the following:

ur1.PNG

 

As you can see, when I select a year, the rows that don't have a Case ID are logically ignored:

ur2.PNG

 

 

The measure that I'm trying is the following:

Measure = 
CALCULATE (
    SUM(G_L[Amount]);
    FILTER ( G_L; G_L[DEPT] = "610" );
    FILTER ( G_L; G_L[PROJECT] = "FO" );
    FILTER ( G_L; G_L[G_L Account Nr] = "3110" || G_L[G_L Account Nr] = "3130" );
    USERELATIONSHIP ( G_L[Posting date]; 'Date'[Date] )
)

 

However, as you can see in the 2 screenshots above, I'm getting blank results. 

The desired result is 3600.

I have uploaded this dummy file here: https://drive.google.com/file/d/1XEmbc4Z0DOq_cG3OU3ZaVi4FL8fc97qJ/view?usp=sharing

 

I would really appreciate some assistance 🙂

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @setis 

 

Try this

Measure = 
CALCULATE (
    SUM(G_L[Amount]),
    G_L[DEPT] = "610",
    G_L[PROJECT] = "FO",
    G_L[G_L Account Nr] IN { "3110", "3130" },
    USERELATIONSHIP ( G_L[Posting date], 'Date'[Date] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @setis 

 

Try this

Measure = 
CALCULATE (
    SUM(G_L[Amount]),
    G_L[DEPT] = "610",
    G_L[PROJECT] = "FO",
    G_L[G_L Account Nr] IN { "3110", "3130" },
    USERELATIONSHIP ( G_L[Posting date], 'Date'[Date] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi @Mariusz ,

 

It's works! WHY? 🙂 

 

Thank you so much!

Mariusz
Community Champion
Community Champion

Hi @setis 

 

I think its because of the table insight the FILTER( ) is still preserving filter context without USERELATIOSHIP applied,

in your scenario using FILTER was not necessary or beneficial anyway.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.