Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Userelationship wrong result with a used column

Hello ,

 

I have issues with Userelationship function.

 

In fact I have two measures :

 

Total_Amount_Direct =
CALCULATE (
SUM (Fact1[money] );
DATESYTD( 'Date_Table'[Date] );
FILTER ( Dimension; Dimension[Filter_Column] = "Physical")
)

 

Total_Amount_UserRelationShip =
CALCULATE (
SUM (Fact2[Amount] );
DATESYTD( 'Date_Table'[Date] );
FILTER ( Dimension; Dimension[Filter_Column] = "Physical");
USERELATIONSHIP ( Fact2[ID]; Fact1[ID] )
)

This is the result :

 

When I add the Filter Column to the table everything come wrong?

 

Is this the effect of the USERELATIONSHIP Function?

 

I need to add new Dimension ( copy of the existing Dimensio) to filter the table and have the good result?

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago
    Repeating myself... Please never, ever, ever join 2 fact table directly to each other. This is one of the worst things you can do in data modeling. Please use the correct design patterns unless you want to suffer in the future. 2 fact tables must always be joined to common (conformed) dimensions and slicing can ONLY be performed via the attributes of the dimensions, never directly on the columns of the fact tables.

    If you deflect from this golden rule, you'll very soon start creating numbers nobody will be able to understand, including you.

    There are plenty of vids on YT that explain how to build correct models. Please watch them before you shoot yourself in the foot.

    Best
    D

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Greg,

       

      This is my Schema :

       

       

       

      I think when we want to across the dimension column returned from the USERELATIONSHIP then I cant see nothing as result 

       

      I think it's a DAX Logic

      • Anonymous's avatar
        Anonymous
        Not applicable
        Repeating myself... Please never, ever, ever join 2 fact table directly to each other. This is one of the worst things you can do in data modeling. Please use the correct design patterns unless you want to suffer in the future. 2 fact tables must always be joined to common (conformed) dimensions and slicing can ONLY be performed via the attributes of the dimensions, never directly on the columns of the fact tables.

        If you deflect from this golden rule, you'll very soon start creating numbers nobody will be able to understand, including you.

        There are plenty of vids on YT that explain how to build correct models. Please watch them before you shoot yourself in the foot.

        Best
        D