Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

USERELATIONSHIP ISSUE !!!!!

Dear All,

 

I have an issue with the USERELATIONSHIP dax function, I have a blank result when I use it on my measures :

First of all this is my schema :

 

 

Then this is my measures :


AmountTotal_1 = CALCULATE(SUM ( Table1[amt] );DATESINPERIOD ( Date[Date]; MAX ( Date[Date] ); 10; YEAR );
USERELATIONSHIP ( Table1[ID]; Table2[ID] )
)

AmountTotal_2 = CALCULATE(SUM ( Table1[amt] );DATESINPERIOD ( Date[Date]; MAX ( Date[Date] ); 10; YEAR )
)

 

AmountTotal_3 = CALCULATE(SUM ( Table2[amount] );DATESINPERIOD ( Date[Date]; MAX ( Date[Date] ); 10; YEAR );
USERELATIONSHIP ( Table1[ID]; Table2[ID] )

 

This is the result :

 

 what looks strange is when I am using the same Measure with Table 2, it's working (AmountTotal_3)

 

Is there any problem with the granularity?

Is there any Function to add to avoid this?

Any Help please?

1 Reply

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

     

    It might be to do with the decision that the engine has to make to switch off one of the relationships with Date table, try this.

     

    AmountTotal_1 =
    CALCULATE (
        SUM ( Table1[amt] );
        DATESINPERIOD ( Date[Date]; MAX ( Date[Date] ); 10; YEAR );
        USERELATIONSHIP ( Table1[ID]; Table2[ID] );
        CROSSFILTER( Table1[Date]; Date[Date]; none )
        -- or CROSSFILTER( Table2[Date]; Date[Date]; none )
    )

     

     
    Best Regards,
    Mariusz

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

    Please feel free to connect with me.
    LinkedIn