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
suzsword
Frequent Visitor

USERELATIONSHIP help - measure not using the relationship

I have a problem with the context being lost when calculating measures. I've attached the relationship that is being used.

RelationshipRelationship

I have two measures (Today's Value and Yesterday's Value) created that include USERELATIONSHIP so that the inactive relationship is used.

 

 

Today's Value = CALCULATE(SUM('pds V_BOPD'[BOPD]),
FILTER('pds V_BOPD', 'pds V_BOPD'[full_date]=DATEVALUE("21-feb-2019")), USERELATIONSHIP( 'pds V_BOPD'[field] , DimFieldList[Fieldname])
)

I then created another measure that indicates whether there is an increase or decrease in values and shows a coloured circle depending on the value. 

 

Arrows = SWITCH(
    TRUE(),
    ISBLANK([Yesterday's Value]), BLANK() & "Missing Data",
    ISBLANK([Today's Value]), BLANK() & "Missing Data", 
    [Today's Value] = [Yesterday's Value], CONCATENATE(UNICHAR(9898) ," No Change"), 
    [Today's Value] > [Yesterday's Value], CONCATENATE(UNICHAR(128309), " Increase"), 
    [Today's Value] < [Yesterday's Value], CONCATENATE(UNICHAR(128308), " Decrease"), 
    BLANK() )

As soon as I add the Arrows measure, the results are basically showing a cartesian product, where each field is showing against each site.  What am I missing?

 

Correct Results - without Arrows MeasureCorrect Results - without Arrows Measure

 

 
 
 
 
 
 
 
 
 
Results when Arrows measure is used - every field is showing with every siteResults when Arrows measure is used - every field is showing with every site
1 ACCEPTED SOLUTION

@suzsword  if you remove the site code, it removes the cartesian, the issue is because you dont have a relationship on the table that has site code, therefore it returns everything





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

@suzsword  any chance you can share the file?  or provide some data?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




You should be able to get the file from Here

 

 

Changing the order of the USERELATIONSHIP function made no difference. 


Thanks

Susan

@suzsword  if you remove the site code, it removes the cartesian, the issue is because you dont have a relationship on the table that has site code, therefore it returns everything





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg I have similar problem but i have got relationship defined but still receiving cartesian product output. 

Once i remove the measure with function - it works with direct column but not with the measure with function. 

Please advise. 

https://community.powerbi.com/t5/Desktop/Data-is-Off/m-p/710786#M343188

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.