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

DAX UseRelationship

Can someone please help me understand if I'm using the proper dax function to achieve the following?

 

I have a factSales table and a Date Dim table. The fact table has OrderDate and ShipDate. I have an active relationship between OrderDate from my fact table and Date from my Date Dim table. I have an inactive relationship between ShipDate on my facttable and Date on my Date Dim table. This works fine

CALCULATE([Total Sales by Ship Date],USERELATIONSHIP('Dim Date'[Date],FactSales[ShipDate])). I don't necessarily always want to use an aggregate though. 
What I would like to do is return something like Day of Week for my ShipDate from the Date Dim table. Is the USERELATIONSHIP the proper approach in this case? 

nchamilton162_0-1739375624850.png

 



Thank you
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

In the Calendar table, via the FORMAT() function, extract the day of the week.  Try this measure then

Measure = calculate(max('Dim Date'[Day of week]),USERELATIONSHIP('Dim Date'[Date],FactSales[ShipDate]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

 @Anonymous I don't think you understood the question from the OP, and becuase of that your answer is not relevent. 

 

@nchamilton162 check this video on my YT channel and I hope it helps. RELATED DAX function with inactive relationships in Power BI

 

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @nchamilton162 ,

 

Of course you can, but there is already an active relationship between OrderDate from fact table and Date from Date Dim table, so there is no need to create another one-to-many relationship for the Date from Date Dim table

 

In addition to USERELATIONSHIP, you can also use RELATED to get Day of Week. Create custom column in fact table with below DAX.

Column = RELATED('Dim Date'[Day of Week])

 

 

 

——————————————————————————————————————————————————

If my answer helps you solve the problem, please accept my answer as a solution and let it be seen by more people in need.

 

Best regards,

Mengmeng Li

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.