Forum Discussion
Why use RELATED function?
Can someone provide me some examples of when using the RELATED function returns a huge benefit?
If you have two tables and intend on related one column to another, why not just save the time and preprocess that related column into your table of interest? Is RELATING the values together in PBI a size saver? Or is it a matter of how many other tables are sharing this related value?
Or why not just merge the table in PBI upon load?
2 Replies
- amitchandakSuper User
Anonymous ,
Related can be used in one to many relations to use 1 side of the value on many sides. Can be used both in measure and column
Assume you have fact and dim
New column in fact = related(Dim[State])
New measure = Sumx(Fact, Fact[Qty]* related(Dim[Cost]))
As the related need to force a row-level it can be costly operation and measure can be slow, if you use too much of that.
I have faced such slowness and converted part of the measure as a column.
I have discussed few approaches here
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8 - daxer-almightySolution Sage
Regarding your doubts... You wanna see a horror story if you have a singe-table model? Go to this place and read/watch: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Why-one-table-models-will-produce-WRONG-NUMBERS/td-p/1904161