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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
CarlsBerg999
Helper V
Helper V

USERELATIONSHIP not working

Hi,

 

I have a DAX code below that doesn't seem to activate the correct relationship on my data model. The SUM is correct, but it returns on the wrong date. What is wrong and how to fix?

In the model, there are following relationships:

One-to-One relationship between Table2 & Table1 (Active)

One-to-Many relationship between DateTable & Table1 (Active)

One-to-Many relationship between DateTable & Table1 (Inactive)

 

The DAX applied is:

 

Revenue Recognition =

 

VAR RevenueRecognition = CALCULATE (

    SUM ( ‘Table1’[Net Value] ),

    FILTER (

        ‘Table1’,

        ‘Table1’[Invoice Status] = "Invoiced"

    ),

    FILTER (

        ‘Table1’,

        RELATED ( 'Table2'[Indicator] ) = TRUE

    ),

    FILTER (

        ‘Table1’,

        ISBLANK(‘Table1’[Work Started on Task]) = FALSE

    )

)

 

Return

CALCULATE(RevenueRecognition,USERELATIONSHIP(‘Table1’[Work Started on Task],DateTable[Date]))

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @CarlsBerg999 ,

 

The userelationship function specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. Since no detailed data model is provided, you can check whether the [Work Started on Task] field in ‘Table1’ meets the requirements based on the information provided in the official website document below, and try again after modifying it.

v-henryk-mstf_0-1617160283015.png

Check the document link.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @CarlsBerg999 ,

 

The userelationship function specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. Since no detailed data model is provided, you can check whether the [Work Started on Task] field in ‘Table1’ meets the requirements based on the information provided in the official website document below, and try again after modifying it.

v-henryk-mstf_0-1617160283015.png

Check the document link.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VijayP
Community Champion
Community Champion

@CarlsBerg999 

USERELATIONSHIP works on similar columns viz.., Date in Date Table and date in another table

In your example, if  Workstarted on Task is Date  then use VALUES(‘Table1’[Work Started on Task])

Let me know if any assitance required

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors