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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Userelationship in a measure with other Filters applied yields wrong results

 

Hello everyone, I have one fact table and one master calendar. The master calendar has an active relationship on open_date and one inactive calendar on close_date (this is a ticketing system)

 example_model.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And I also have one measure:
Measure1 = CALCULATE(SUM(FactTable[hrc_u_volume]),FILTER(FactTable,FactTable[^states_groups]="Resolved"),USERELATIONSHIP(Mastercalendar[DateText],FactTable[closed_at_text]))

Measure2 = CALCULATE(SUM(FactTable[hrc_u_volume]),USERELATIONSHIP(Mastercalendar[DateText],FactTable[closed_at_text]))

And the weird thing is, if I put Measure 2 in some graph and put as visual filter : ^states_groups]="Resolved"

I yield the right result

If i use directly Measure2 I have less results (wrong result)because somehow it counts the ^states_groups]="Resolved" but also filters using the active relationship.

So instead of just using the Resolved filter and the inactive (turned active) relationship... somehow it also uses the default Active Relationship (which should not).

Why when I use that extra Filter on Measure1 it "activates" the relationship I am trying to avoid?

Best Regards!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Measure one has to be written like this to yield correct results, dont really know why though:

Measure1 = CALCULATE(SUM(FactTable[hrc_u_volume]),FactTable[^states_groups]="Resolved",USERELATIONSHIP(Mastercalendar[DateText],FactTable[closed_at_text]))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Measure one has to be written like this to yield correct results, dont really know why though:

Measure1 = CALCULATE(SUM(FactTable[hrc_u_volume]),FactTable[^states_groups]="Resolved",USERELATIONSHIP(Mastercalendar[DateText],FactTable[closed_at_text]))

@Anonymous thanks for your answer, I faced the same problem.

 

I do wonder why this is the case though. If we use "USERELATIONSHIP", we shouldn't use the "FILTER" function if we want to filter over the same table as the table used in the expression?

 

 

v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Could you please post some screenshots of the results returned by above two scenarios to show us the difference?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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