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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

USEREALTIONSHIP convert to date in VAR

Hello everyone

I have a calendar table date column that I'm trying to connect to my main table with an arrival date column. However, the arrival date is in date and time format.

The question is: How can I convert the arrival date to use userelationship in my measure without creating a new date-only column?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Syndicate_Admin 

Thanks for the reply from @PhilipTreacy .

I create a sample table:

vyohuamsft_0-1716192708366.png

vyohuamsft_1-1716192740808.png

First, create an inactive relationship between the two tables.

vyohuamsft_2-1716192937030.png

 

Then create a DAX measure, and use the USEREALTIONSHIP function to specify the inactive relationship.

ShipDate_RM3 = CALCULATE(
    SUM('Table'[Quantity]),
    USERELATIONSHIP('Date'[Date], 'Table'[Arrival Date]),
    FILTER('Table', 'Table'[Source] = "RM3")
)

Here is my preview:

vyohuamsft_3-1716193005120.png

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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
Anonymous
Not applicable

Hi, @Syndicate_Admin 

Thanks for the reply from @PhilipTreacy .

I create a sample table:

vyohuamsft_0-1716192708366.png

vyohuamsft_1-1716192740808.png

First, create an inactive relationship between the two tables.

vyohuamsft_2-1716192937030.png

 

Then create a DAX measure, and use the USEREALTIONSHIP function to specify the inactive relationship.

ShipDate_RM3 = CALCULATE(
    SUM('Table'[Quantity]),
    USERELATIONSHIP('Date'[Date], 'Table'[Arrival Date]),
    FILTER('Table', 'Table'[Source] = "RM3")
)

Here is my preview:

vyohuamsft_3-1716193005120.png

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

PhilipTreacy
Super User
Super User

Hi @Syndicate_Admin  @golire 

 

What exactly are you trying to do?

 

You don't need to create a new date column from the date/time to use it in measures.  You could just use functions like YEAR, MONTH and DAY with DATE to create a date.

 

The answer depends on what it is you want to do.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.