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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dvn_charles
Frequent Visitor

Which performs better TREATAS or USERELATIONSHIP?

Hi Guys 

 

From a performance perspective which performs better  TREATAS or USERELATIONSHIP?

 

Kind regards

Devon

1 ACCEPTED SOLUTION
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

3 REPLIES 3
dvn_charles
Frequent Visitor

Hi @Daryl-Lynch-Bzy 

 

Thank you kindly for the reply.

I have read through the articles they dont really answer my question.

Which I think I might be asking in an incorrect manner. 

What im really after is a function that replicates USERELATIONSHIP() but runs faster in a standard situation?

 

Kind regards

Devon

Hi @dvn_charles 

 

The usage and return value of the two functions are completely different. 

 

USERELATIONSHIP is generally used to activate the inactive relationship between fields in two tables, acting on the specific measure.
TREATAS returns a table that can be used to join two completely different tables with the same data structure.

Best for use when a relationship does not exist between the tables. If you have multiple relationships between the tables involved, consider using USERELATIONSHIP instead.

vjaneygmsft_0-1643871816640.png

I don't think there is a function that does the same thing as USERELATIONSHIP. And this function doesn't seem to particularly affect the speed of the code. If you could be more specific about your problem.

More details in reference:

USERELATIONSHIP function (DAX) - DAX | Microsoft Docs

TREATAS function - DAX | Microsoft Docs

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.