Using RELATED and RELATEDTABLE in DAX

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024
  • Why and when to use RELATED and its companion function RELATEDTABLE: two common DAX functions that are required when using a row context with relationships.
    Article and download: sql.bi/751669?...
    How to learn DAX: www.sqlbi.com/...
    The definitive guide to DAX: www.sqlbi.com/...

ความคิดเห็น • 43

  • @sanjeevgupta7177
    @sanjeevgupta7177 2 ปีที่แล้ว +12

    Alberto, I find your content very accurate and meaningful. Respect from the bottom of my heart. You are a Maestro. I have learnt a lot from your videos. I cannot afford your courses but access to the free videos on TH-cam are helping me a lot. Thanks for such a series of wonderful videos.

  • @AhmedKhaliet
    @AhmedKhaliet ปีที่แล้ว +1

    From all of my heart, thank you ❤️

  • @joaoluismartins
    @joaoluismartins 2 ปีที่แล้ว +3

    Great video, finally understanding the use of RELATEDTABLE() function. However, I've got a question on this one.
    What is difference between using CONTROWS ( RELATEDTABLE (SALES) ) and applying Context Transition CALCULATE ( COUNTROWS (SALES) ). I suppose both would generate the same result/values. Is there any performance impact?

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว +2

      They are identical, same result, same performance.

  • @info2satish
    @info2satish 2 ปีที่แล้ว +2

    Always waiting for your next video...a new DAX learner, your videos give so in depth knowledge... Thanks 🙏👍

  • @erinfield1943
    @erinfield1943 3 หลายเดือนก่อน

    2:02 - RELATED
    -- creates a calculated column in Sales (Many) and accesses a column in Product (One)
    7:41- RELATEDTABLE

  • @rjbush7955
    @rjbush7955 ปีที่แล้ว +1

    Maybe RELATED should be renamed RELATEDVALUE so it is clearer.?

  • @insidehead
    @insidehead 7 หลายเดือนก่อน +1

    from which resource do u study? u r amazing. your teaching skills r amazing..

  • @MarcosRezinovsky
    @MarcosRezinovsky 11 หลายเดือนก่อน +1

    Excelent. Practical. Real use cases.
    Expaining what works and what do not work?
    I´d like to get the same in spanish 😀

  • @ed2921
    @ed2921 2 ปีที่แล้ว +1

    The catch cry “enjoy DAX” is only possible because of SQLBI
    DAX = RELATED (SQLBI)

  • @peanut-d-cat
    @peanut-d-cat 2 ปีที่แล้ว +2

    I may not be able to thank you everyday but i am trully grateful everytime i watch your videos.these learning gems are easy to watch i mean i dont get intimidated why I don't understand because i knew you will double down on the concept. Bless you sir.

  • @fungsweewong3774
    @fungsweewong3774 2 หลายเดือนก่อน

    Can Related function get the "Text value" from the related dimension table? If yes, please show an example. TIA

  • @yusufbas035
    @yusufbas035 2 ปีที่แล้ว +1

    I love the data formatting in Power BI.
    It's the easiest and the most dangerous thing.
    if you know what are you doing it took only 1 min
    but only one mistake can collapse all your data.

  • @AdrianRodriguez-qk9uo
    @AdrianRodriguez-qk9uo 19 วันที่ผ่านมา

    and who knows that in Tableau has a similar function or it's easy with their Tableau SQL motor?

  • @Bharath_PBI
    @Bharath_PBI 2 ปีที่แล้ว +1

    Thank you, I always thought in (weak) limited relationships both RELATED() and RELATEDTABLE() does not work. This video helps but also makes me think which other DAX functions works (and do not work) in limited relationships.

  • @rajunagavelli007
    @rajunagavelli007 7 หลายเดือนก่อน +1

    I am learning BI, but I've got enough confident only after watching your tutorials, A Big thank You Alberto :)

  • @matthiask4602
    @matthiask4602 2 ปีที่แล้ว +1

    Thank you, Alberto. I had a RELATED problem just last week. This is so helpful.

  • @yuriperesf
    @yuriperesf 6 หลายเดือนก่อน

    Great video as always!
    I have a question:
    Considering the following DAX queries
    A: EVALUATE ADDCOLUMNS ( SUMMARIZE ( 'Product', 'Product'[ProductSubcategoryKey] ), "Subcategory", RELATED ( ProductSubcategory[ProductSubcategory] ) )
    B: EVALUATE ADDCOLUMNS ( 'Product', "Subcategory", RELATED ( ProductSubcategory[ProductSubcategory] ) )
    Why does query A doesn't work while query B works?
    What does the SUMMARIZE (or SELECTCOLUMNS for that matter) do that it causes the RELATED function to stop working?

    • @SQLBI
      @SQLBI  6 หลายเดือนก่อน +1

      Query A performs a GROUPBY and the result is not a row in Product, but a value in Product[ProductSubcategoryKey]. Because RELATED is a function that "unlocks" the access to the expanded table (which is an internal implementation detail), when the row context is not on Product, you do not have access to the expanded table. The result of SUMMARIZE / SUMMARIZECOLUMNS is never a table that has relationships in the model, it's always a table that still keeps the data lineage of the columns, but cannot leverage model relationships.

  • @VictorHugo-bd3bf
    @VictorHugo-bd3bf 2 ปีที่แล้ว +1

    Excellent explication, Alberto. Thanks so much.

  • @antygona-iq8ew
    @antygona-iq8ew 4 หลายเดือนก่อน +1

    Excellent explanation, clear and easy to understand.

  • @ChristianKey
    @ChristianKey 2 ปีที่แล้ว +1

    Thanks for the video. This is very useful to know.

  • @krisihari
    @krisihari 2 หลายเดือนก่อน +1

    Your explanations are always on another level!

  • @Milhouse77BS
    @Milhouse77BS 2 ปีที่แล้ว +1

    LOOKUPVALUE also doesn't work with a limited relationship, in my experience.

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      Yes, RELATED only works with regular relationships.

  • @willianthalles
    @willianthalles 2 ปีที่แล้ว +1

    Well explained professor! Thanks and keep bringing it up

  • @datawhipper
    @datawhipper 2 ปีที่แล้ว +1

    Thanks for this great video Alberto. Can you talk more on the Island you talked about when explaining limited and strong relationship. Thanks

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      See this: www.sqlbi.com/articles/strong-and-weak-relationships-in-power-bi/

  • @mohamedfouad7958
    @mohamedfouad7958 2 ปีที่แล้ว +1

    Thanks Alberto for your easy explanation

  • @sandeepbarge4699
    @sandeepbarge4699 11 หลายเดือนก่อน

    Are there any scenarios when we need not use RELATED and RELATEDTABLE functions to access column from another table?

  • @e.l.2405
    @e.l.2405 ปีที่แล้ว

    wrong E-R schema, because ProductDQ should be connected to Product table, not to Sales table.

  • @Bharath_PBI
    @Bharath_PBI 2 ปีที่แล้ว

    A question out of this topic, is there any way to retrieve the historical refreshes that occurred on the SSAS Tabular model (something like refresh history in PBI Premium datasets)? Thanks in advance for your guidance.

  • @yusufbas035
    @yusufbas035 2 ปีที่แล้ว +1

    this man is amazing.
    he never gets tired of this.

  • @pratikfutane8131
    @pratikfutane8131 2 ปีที่แล้ว +1

    Masterstroke 💯👌👌🦸‍♂️

  • @uyu96
    @uyu96 2 ปีที่แล้ว

    But for limited relationships we need a refresh of the dataset to get the data from Direct query

  • @SandipanSarkar-c8v
    @SandipanSarkar-c8v 2 หลายเดือนก่อน

    Finished watching

  • @sahilsukhadeve
    @sahilsukhadeve 2 ปีที่แล้ว +1

    Man🔥🔥👍

  • @anikeetdey3411
    @anikeetdey3411 ปีที่แล้ว

    Can you provide the data sets user please. so that we can practice it properly..plzz 🙏

    • @SQLBI
      @SQLBI  ปีที่แล้ว

      Follow the link in the description!

  • @tolgakaptan6633
    @tolgakaptan6633 ปีที่แล้ว

    Hello. How do you increase the font size of the formula bar easily?

  • @EnneagramTarot-zu8kp
    @EnneagramTarot-zu8kp 10 หลายเดือนก่อน

    *NEW COLUMNS*
    3:00- RELATED
    4:30- IF(RELATED)
    6:00- demonstration on how RELATED doesn't work with a limited relationship
    8:30- COUNTROWS(RELATEDTABLE)
    10:39- AVERAGEX(RELATEDTABLE)
    12:40- AVERAGEX(ALLNOBLANKROW)...COUNTROWS(RELATEDTABLE)
    *NEW MEASURES*
    14:50- SUMX(COUNTROWS(RELATEDTABLE))