Building relationships between tables when both have duplicates

Поделиться
HTML-код
  • Опубликовано: 18 окт 2016
  • PowerPivot and Power BI Desktop only allow the creation of relationships between tables when one of columns forming the relationship does not have duplicate values.
    In order to relate these two tables to one another, what we need is a third table with all distinct values from both tables. In this tutorial we will show you how to do just that.
    Link to Power BI file used in the video, get file #41 on the community downloads folder: curbal.com/donwload-center
    SUBSCRIBE to learn more about Power and Excel BI!
    / @curbalen
    Our PLAYLISTS:
    - - Join our DAX Fridays! Series: goo.gl/FtUWUX
    - - Power BI dashboards for beginners: goo.gl/9YzyDP
    - - Power BI Tips & Tricks: goo.gl/H6kUbP
    - - Power Bi and Google Analytics: goo.gl/ZNsY8l
    ABOUT CURBAL:
    Website: www.curbal.com
    Contact us: www.curbal.com/contact
    QUESTIONS? COMMENTS? SUGGESTIONS? You’ll find me here:
    ► Twitter: @curbalen, @ruthpozuelo
    ► Google +: goo.gl/rvIBDP
    ► Facebook: goo.gl/bME2sB
    #SUBSCRIBE #CURBAL
    ► Linkedin: goo.gl/3VW6Ky

Комментарии • 398

  • @leonidiakovlev
    @leonidiakovlev 4 года назад +13

    It is a good habit to create lookup tables for every dimension at the model design stage. These 2 tables in the beginning of the video are actually two fact tables with shared dimension (Product), bu different metrics (Sales and Stocks). What Curbal did was the creating the Product lookup table.
    Elegantly presented and explained, Curbal! Thanks!

    • @CurbalEN
      @CurbalEN  4 года назад +3

      Thanks Leo,
      /Ruth

  • @jda817
    @jda817 5 лет назад +30

    THIS WAS THE FIX!!! Thank you for providing something of value and not ruining it with fluff. My project can proceed!

    • @CurbalEN
      @CurbalEN  5 лет назад +4

      Excellent! Go,go,go!
      /Ruth

  • @hendrik-stack22
    @hendrik-stack22 Год назад +1

    6 years later and still relevant, THX Curbal

  • @Everyonelovesyou
    @Everyonelovesyou 4 года назад

    Hi, I have learnt a lot from your videos...I am PQ user since 2016....This is one of those rare solutions which I explored with my common sense in beginning......and always believed that this is just a way round.....Happy to see it is authenticated in your tutorials......Stay Blessed

  • @YHWH979
    @YHWH979 4 года назад +3

    Thank you Miss. Ruth for your kind video, you helped me at the moment when I am about to give-up my project

  • @giorgioiribarren
    @giorgioiribarren 5 лет назад

    Rut, es increíble!. Segunda vez en el mes que viendo tus videos e solucionado un problema en mis reportes que en ninguna otra parte me han orientado de la forma precisa que lo haces. Muchas gracias. Estoy seguro que el curso de Curbal es potente. Voy a ahorrar unos pesos para pagarlo. Definitivamente. Y adicionalmente, disfruto con tu carisma y encanto!. Gracias Rut, espero entiendas español. Saludos desde Santiago de Chile.

    • @CurbalEN
      @CurbalEN  5 лет назад +1

      Hola Jorge!
      Si,si, soy española (Asturiana) :)
      Me alegro mucho de que mis vídeos te sean útiles!!
      Saludos !
      /Ruth

  • @codingwannabe
    @codingwannabe 4 года назад

    Love your channel, the more I browse your videos the more I'm tempted to subscribe to your Power BI courses. Great job!!

  • @sumantjoshi490
    @sumantjoshi490 2 года назад +1

    Thanks Ruth for explaining complex scenario in a simple way. Really understood the concept in detail. Many thanks ❤️❤️

  • @AlvinRyellPrada
    @AlvinRyellPrada 3 года назад +3

    This is awesome!
    I really love the fact that you made it simple and easy for me to understand it. Short video yet powerful. Thank you for advocating the making the complex simple in powerbi! 💜💜❤️

    • @CurbalEN
      @CurbalEN  3 года назад

      And thanks for the feedback!

  • @nancmadi
    @nancmadi 4 года назад +1

    THANK YOU SO MUCH FOR MAKING THIS SO SIMPLE... I have been trying to find this fix everywhere!

    • @CurbalEN
      @CurbalEN  4 года назад +1

      Glad to hear that! :)
      /Ruth

  • @navitaw8876
    @navitaw8876 5 лет назад +1

    Exactly what I was looking for. Thank you very much!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Yey!! You welcome!!
      /Ruth

  • @immanuelh4637
    @immanuelh4637 7 месяцев назад

    You have virtually taught me everything I know about power bi for free. Thank you very many much. I wish you a happier new year.

  • @fernandoferreira9062
    @fernandoferreira9062 6 лет назад +2

    I'm so happy I found this video! Thank you a lot!

    • @CurbalEN
      @CurbalEN  6 лет назад

      You welcome :)))
      /Ruth

  • @amandafernandesramospasson5862
    @amandafernandesramospasson5862 4 года назад +1

    THANK YOU! this was just what i was looking for

  • @cyrub2132
    @cyrub2132 5 лет назад +1

    You are amazing!!!! Every time I have a problem you always have a nice solution. Thank you so much! :)

    • @CurbalEN
      @CurbalEN  5 лет назад

      Excellent ! Happy to be useful :)
      /Ruth

  • @JenntheGeek
    @JenntheGeek Год назад

    Thank you for posting this, it worked nicely and fairly simple for a power BI beginner like me :)

  • @aliciapeel9561
    @aliciapeel9561 3 года назад +1

    This is explained so simply thank you! One thing I've been struggling with is how you go about this if you want to create a new 'ID' based on multiple column values. If I do it this way as that ID table links to the original table so I then have to create a new data table with the ID table and original table merged. I have no idea if this is a good way to go about it but its the only way I've been able to get my head around the problem!

  • @HarishS12137
    @HarishS12137 4 года назад

    Thank you for this tips, much needed for a beginner!!

  • @mariomdssaldanha5353
    @mariomdssaldanha5353 Год назад

    Thanks so much for your guidance and easy explanation of concepts.

  • @phorton968
    @phorton968 Год назад

    Beautifully elegant! You are the Power Bi fairy godmother.

    • @CurbalEN
      @CurbalEN  Год назад

      Sprinkling knowledge everywhere ✨

  • @NorbertoVeraReatigaNVR
    @NorbertoVeraReatigaNVR 7 лет назад +1

    Muchas gracias, Ruth!!, Excelente truco...

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Norberto Vera Reatiga Verdad? Sencillo y rápido de hacer!
      /Ruth

  • @robertshore2989
    @robertshore2989 4 года назад

    Amazing - you've made that so simple to understand after days searching for a solution.

    • @CurbalEN
      @CurbalEN  4 года назад

      Yey!!Music to my ears!!

    • @robertshore2989
      @robertshore2989 4 года назад

      @@CurbalEN I'll never understand why Power BI complicates tasks that are so easy in Excel - again - thank you and you have a new subscriber here.

  • @LotfyKozman
    @LotfyKozman 7 лет назад +2

    Nice trick and helps in solving many problems. Thanks

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Lotfy Kozman You welcome Lofty, glad it helped you :)
      /Ruth

  • @nicholasspaeth9790
    @nicholasspaeth9790 Год назад

    This exact solution didn't work for my particular case, but it gave me a better understanding of what I needed to do. Thanks to this, I was able to resolve my troubles!

  • @andreawilliams9793
    @andreawilliams9793 5 лет назад +1

    Helped me a lot thanks, i was struggling with exactly this problem, thanks again

    • @CurbalEN
      @CurbalEN  5 лет назад +1

      Wonderful Andrea, glad it was helpful!
      /Ruth

  • @bigpapa112998
    @bigpapa112998 6 лет назад +1

    Thank you, this was great exactly what I needed.

    • @CurbalEN
      @CurbalEN  6 лет назад

      Excellent! Glad it helped :)
      /Ruth

  • @WarpinFadey
    @WarpinFadey 6 лет назад +1

    simple and easy way at least for beginners! many thanks!

    • @CurbalEN
      @CurbalEN  6 лет назад

      Thanks Alexandr! :)
      /Ruth

  • @yishaktaye1951
    @yishaktaye1951 3 года назад

    Very Helpful video. Thank You.

  • @stududs
    @stududs 2 года назад

    Thank you , at last a clear simple explanation I can understand!

  • @hatim4436
    @hatim4436 Год назад

    Thank you for the video! It help me solve almost all my problems. Some things that I found out: 1. You can use same concept in excel 365. 2. If your data is date based, then create a table of unique date and connect it in between the 2 original tables that you had. Again, thank you @Curbal!!!

  • @piroro195
    @piroro195 3 года назад

    helped after trying to figure it out for the past two days whew.. Thank you so much

  • @agapheputrasusilo741
    @agapheputrasusilo741 9 месяцев назад

    Life saver, i was looking for this. thank you

  • @jereyeses
    @jereyeses 7 лет назад +2

    Muchas Gracias! Maravilloso!

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Jesús Reyes De nada Jesús!
      /Ruth

  • @KrazyWorldWars
    @KrazyWorldWars Год назад

    I been looking for this for past several days ...

    • @CurbalEN
      @CurbalEN  Год назад

      Here you have all my content indexed:
      curbal.com/curbal-learning-portal

  • @asifshaheer
    @asifshaheer 7 лет назад +1

    Very nice and simple approach...thanks for helping us solving such problems

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Asif Hi Asif! My pleasure to be able to help!
      Thanks for your feedback! :)
      /Ruth

  • @sembitoumbou8989
    @sembitoumbou8989 3 месяца назад

    You're a LEGEND. Thank you ma'am

  • @dennismitchell4836
    @dennismitchell4836 5 лет назад +1

    This was so useful, thank you.

    • @CurbalEN
      @CurbalEN  5 лет назад

      You welcome!!
      /Ruth

  • @jerzsubbie
    @jerzsubbie 3 года назад

    Thank you, this helps me a lot!

  • @saikathbose8120
    @saikathbose8120 4 года назад

    Very useful! Thank you!

  • @RajanieshKaushikk
    @RajanieshKaushikk 5 лет назад

    You ate the master of powerBI and DAX

    • @CurbalEN
      @CurbalEN  5 лет назад

      Thanks, glad you like my videos!
      /Ruth

  • @user-wg1ns3yu3j
    @user-wg1ns3yu3j Год назад +1

    Thanks, you saved me half a day!

  • @alsch4387
    @alsch4387 Год назад

    Thank you so much for your solution , I find the many ways to resolve this problem.

  • @shafiulamin4128
    @shafiulamin4128 4 года назад

    Fantastic. Very helpful trick.

  • @immanuelh4637
    @immanuelh4637 Год назад

    I love you videos. Thank you so much

  • @ruroshinzynaruto
    @ruroshinzynaruto 6 лет назад +1

    Perfect. Thank You

    • @CurbalEN
      @CurbalEN  6 лет назад +1

      My pleasure ;)
      /Ruth

  • @jiyaadnaeem4802
    @jiyaadnaeem4802 5 лет назад

    Thank you so much, it's like magic!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Pure loooooove ;)
      /Ruth

  • @orangutanklaus7035
    @orangutanklaus7035 4 года назад

    AWESOME!!!!! Thank you so much!!!

    • @CurbalEN
      @CurbalEN  4 года назад

      👏👏👏
      /Ruth

  • @suryapavann2572
    @suryapavann2572 6 лет назад +1

    Thanks a ton Ruth Pozuelo.:-)

    • @CurbalEN
      @CurbalEN  6 лет назад

      +suryapavan n You are most welcome:)
      /Ruth

  • @just3963
    @just3963 5 лет назад +1

    Very useful!! Thanks for sharing! :)

  • @ba1dwin
    @ba1dwin 6 лет назад +1

    Thank you very much. Very helpful indeed.

    • @CurbalEN
      @CurbalEN  6 лет назад

      Excellent! Glad it helped :)
      /Ruth

  • @fuberlin1
    @fuberlin1 3 года назад

    2020 this is still great help! helped me finish work :))

  • @AllscanTwelve
    @AllscanTwelve 5 лет назад

    Thanks for the tutorial. It really works! My question now is, why "(Blank)" appears in one of the selections using Slicer? How can I get rid of it?

  • @eriol33
    @eriol33 5 лет назад +1

    thank you for this. I think I have been doing things wrong with power BI as I did left join to my tables instead of creating a relationship, I suffer a very big performance penalty despite relatively low number of tables. I think this is the best practice!

    • @CurbalEN
      @CurbalEN  5 лет назад +1

      Yes!! That is the way most of us travelled before we found a better path. Just keep going!
      /Ruth

  • @coolboyboy2087
    @coolboyboy2087 5 лет назад

    solved my problem!! thanks much!!!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Yes!!! Music to my ears 🎶
      /Ruth

  • @wisnudanang5819
    @wisnudanang5819 2 года назад

    Thank you for sharing !! This was the fix, i wish you great great all time

  • @vagnao1982
    @vagnao1982 5 лет назад +1

    Thank you! You have help-me!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Excellent, happy to help!
      /Ruth

  • @josebernaldez
    @josebernaldez 7 лет назад +1

    Wow, que sencillo truco y yo rompiendome la cabeza.... muchas gracias.

    • @CurbalEN
      @CurbalEN  7 лет назад

      +José Bernáldez Muchas gracias a ti por el comentario, es un placer poder ayudar :)
      Saludos,
      /Ruth

  • @dashingmozy111
    @dashingmozy111 2 года назад

    Thank you so much!!

  • @Laxmanmane007
    @Laxmanmane007 3 года назад

    Thank you so much👍👍

  • @blondeunicrone2695
    @blondeunicrone2695 8 месяцев назад

    My gosh this is sooo helpful ❤

  • @84257542
    @84257542 3 года назад

    Thank you so much

  • @xiomaragotch9453
    @xiomaragotch9453 3 года назад

    very helpful. thanks

  • @anjutamang2542
    @anjutamang2542 5 лет назад

    thank you it was very helpful

    • @CurbalEN
      @CurbalEN  5 лет назад

      Wonderful! And thanks for the feedback :)
      /Ruth

  • @qualityrevolution
    @qualityrevolution 3 года назад +1

    Thanks for this , I tried the same on my data , relationships got created with common column/list (enquiry no. In my case) but I am still not able to fetch data which is in table 1 (source of enquiry in this case) but not in table 2 . Kindly suggest what might be the problem. It still says relationship needs to be established .

  • @grudzinskidaniel
    @grudzinskidaniel 2 года назад

    Great the way :) and the teacher is great!!! :)

  • @jonascarvalho7331
    @jonascarvalho7331 6 лет назад +1

    That was awesome! That trick will spare tons of wasted times for me!

    • @CurbalEN
      @CurbalEN  6 лет назад

      Yey!!! Mission accomplished ;)
      /Ruth

  • @dekmar7954
    @dekmar7954 4 года назад +16

    2:40 - 4:20 can be done with 1 step : )
    Edit, New Formula:
    = Table.Distinct( ManufactTable[[ProductID]] & StockTable[[ProductID]] )
    The "Table[[Column]]" selects 1 column from a table.
    The " & " combines the two 1-column tables together, one on top of the other.
    The "Table.Distinct" removes duplicate IDs from the combined table.
    Use this formula in a separate query, and then load to data model to get your join table.
    -----------------------------------------------------------------------------------------------------------------
    Old Formula:
    = Table.FromColumns( { List.Distinct( ManufactTable[ProductID] & StockTable[ProductID] ) } )

    • @CTaLieN11
      @CTaLieN11 2 года назад +2

      It's a good thing to know its possible that way, but for beginners, which most of us here are, its way too complicated.

    • @AkshayKumar-vd5wn
      @AkshayKumar-vd5wn 2 года назад

      Where again should you write this query?

    • @dekmar7954
      @dekmar7954 2 года назад +2

      ​@@AkshayKumar-vd5wn It should be a separate query from the "ManufactTable" and "StockTable" queries. At to top, you can click the "New Source" dropdown (next to close & apply), then click "Blank Query". Copy the formula above into the formula bar, then load to data model.

    • @AkshayKumar-vd5wn
      @AkshayKumar-vd5wn 2 года назад

      @@dekmar7954 Thanks a bunch. I'll follow up with you when I test this out.

    • @abedalqaderhalaweh7185
      @abedalqaderhalaweh7185 Год назад

      why dont you have videos. I would love to follow you

  • @AGBDej
    @AGBDej Год назад

    Thank you!

  • @emetdara2999
    @emetdara2999 11 месяцев назад

    Thanks Ruth 🙏🙏

  • @asimabdulwahab9444
    @asimabdulwahab9444 6 лет назад

    Excellent Mam!

    • @CurbalEN
      @CurbalEN  6 лет назад

      +Asim Abdul Wahab Thank you Sir!
      /Ruth

  • @stephaniegiovannitti7758
    @stephaniegiovannitti7758 7 лет назад +1

    great short explanation

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Stephanie Giovannitti Great, thanks!
      /Ruth

  • @mailamrutha
    @mailamrutha 4 года назад

    Thank you

  • @mohammadazadi3616
    @mohammadazadi3616 Год назад

    very goog toturial. thanks a lot

  • @casst346
    @casst346 4 года назад

    Excellent! Thanks for Sharing!

    • @CurbalEN
      @CurbalEN  4 года назад

      My pleasure :)
      /Ruth

    • @casst346
      @casst346 4 года назад

      @@CurbalEN can this only be done in Power BI, i cant seem to find the drop down in query viewer to add new query in office 365..

    • @CurbalEN
      @CurbalEN  4 года назад

      Not sure what you mean with office 365, is it excel?

  • @kelliecook4000
    @kelliecook4000 6 лет назад +1

    Thank you-Very helpful. I did have a null value in my data I had to delete after I did all that and then I was able to make my relationships.

    • @CurbalEN
      @CurbalEN  6 лет назад

      +Kellie Cook Glad it worked :) And thanks for the feedback!
      /Ruth

  • @ignacio8428
    @ignacio8428 7 лет назад +1

    te amo con todo mi corazón, he estado intentando hacerlo con DAX pero me complique la vida, muchas gracias, te amo

    • @CurbalEN
      @CurbalEN  7 лет назад

      +ignacio jerez Gracias Ignacio! Menudas pasiones despierta Power BI!!! 😄
      Muchos saludos desde Suecia,
      Ruth

    • @ignacio8428
      @ignacio8428 7 лет назад

      I have one question, ¿ como puedo relacionar 3 o 4 tablas? , ¿ Se puede por este método? , a mi me dio error cuando intente por este método crear otra combinación entre tablas, ¿Como lo hago?

    • @CurbalEN
      @CurbalEN  7 лет назад

      +ignacio jerez Hola Ignacio, depende. Tienes que tener una columna común en cada tabla para poder unirlas.
      /Ruth

    • @ignacio8428
      @ignacio8428 7 лет назад

      Una consulta cuando creo otra tabla new Query no me deja hacer una combinación many to many with make this relationship active, tengo un error ( I cant create a direct active relationship between Tabla1 and Tabla2...) , ¿Que puedo hacer?, ¿What can I do?

    • @CurbalEN
      @CurbalEN  7 лет назад

      +ignacio jerez Hola Ignacio, no Es posible hacer combinaciones many-to-many en Power BI!
      /Ruth

  • @giri41
    @giri41 4 года назад

    Good one .. please do a video on filter dates in table affect the table

  • @MaiTran-xf3op
    @MaiTran-xf3op 3 года назад

    Thank you so much for this video since I have technique to deal with my file with the same problem that is posed in your video. thanks a lotttttttttttt!

    • @CurbalEN
      @CurbalEN  3 года назад

      🥳🥳

    • @MaiTran-xf3op
      @MaiTran-xf3op 3 года назад

      @@CurbalEN I don't know why I do the same thing but it doesn't take effect. the key point is that the unique value is the flight in the single day, I create the list like you with column flight no and flight date. But then after I create relationship between 3 table, 2 data table with the list already created, pivot table still asks me to create relationship and result is not true. Could you kindly explain this for me?

  • @raghukumar4483
    @raghukumar4483 Год назад

    Thanks for this. Could you let me know if I want to get 'StockLocation' column from 'StockTable' table to ManufactTable

  • @javedkhan-tz6fn
    @javedkhan-tz6fn 4 года назад

    Great tip

  • @jacjojhnson9211
    @jacjojhnson9211 Год назад

    Clever you! Thanks.

  • @bharatarse1503
    @bharatarse1503 Год назад

    Amazing i really like it👍 ..keep sharing..☺️

  • @mehmetyuksel469
    @mehmetyuksel469 2 года назад

    Allah razı olsun :)

  • @Sneha2490
    @Sneha2490 5 лет назад

    Hi Ruth, this is a great video. However is there any prerequisite for the columns to have same format. For example - if one is formatted as a whole number and one is text+number, can I still create a relationship through a unique column? Please help.

  • @faisalmughal3669
    @faisalmughal3669 7 лет назад +1

    Thanks a lot!

    • @CurbalEN
      @CurbalEN  7 лет назад

      +Faisal Mughal My pleasure :)
      /Ruth

  • @happyheart9431
    @happyheart9431 Год назад

    Million THANKS

  • @beknazarosmonov8567
    @beknazarosmonov8567 5 лет назад

    Great solution

  • @lakshmikalyanir4510
    @lakshmikalyanir4510 Год назад

    Thanks for sharing the trick. And here I have one question in the same scenario instead of joining on one column(ProductID Key), if I want to join on two columns how its gonna work. Can you please suggest on that.

  • @Sovereign_Lord
    @Sovereign_Lord 4 года назад

    Thank you :)

  • @warunat
    @warunat 2 года назад

    thank you ,its awesome

  • @TheShaha26
    @TheShaha26 5 лет назад +1

    wow. amazing content.

  • @nazmulhaque3894
    @nazmulhaque3894 2 года назад

    Happy to learn 💕

  • @srirammurugudu47
    @srirammurugudu47 5 лет назад

    Thanks Ruth :)

    • @CurbalEN
      @CurbalEN  5 лет назад

      You welcome !
      /Ruth

  • @lequi3259
    @lequi3259 Год назад

    WOWW , Thanks so much

  • @DiscoverTalent143
    @DiscoverTalent143 2 года назад

    Thanks 🙏👍

  • @iffyzaidi824
    @iffyzaidi824 Год назад

    Amazing . Awesome.

  • @Franaman
    @Franaman 6 лет назад +1

    Brilliant!!!!!!!!

    • @CurbalEN
      @CurbalEN  6 лет назад

      Thank youuuu :)))
      /Ruth

  • @houdamesmoudi3685
    @houdamesmoudi3685 7 месяцев назад

    Thanks for trik 🙏😊

  • @rohitnegi6376
    @rohitnegi6376 5 лет назад +1

    Thanks Ruth for the video...it’s helpful.... if you don’t mind I have a question.... I have three tables with three similar columns or headers along with some data... when I create a unique I’d by merging the three columns to make a unique I’d (as separate column) it creates the relationship...however when I create the graph/table it doesn’t give the right data..we need to show data with these three headers filters...please help in resolving the same or please suggest if anything else can be done to create a relationship...

    • @CurbalEN
      @CurbalEN  5 лет назад

      Hi Rohit! Can you post your question in the power bi community?
      Please make sure you give sample data !
      /Ruth

  • @swarnalathareddy
    @swarnalathareddy Год назад

    Does that new query gets updated if any new product ID added in to original tables