Filter top 3 products with a row for others using DAX in Power BI

Sdílet
Vložit
  • čas přidán 10. 07. 2024
  • This video shows an optimized DAX technique to display the first N products for each category in Power BI, adding a row that aggregates the value for all the other products. Article and download: sql.bi/695263/?aff=yt
    The article includes further insights and optimization solutions, whereas the video introduces the scenario and explain the simpler formulas.
    How to learn DAX: www.sqlbi.com/guides/dax/?aff=yt
    The definitive guide to DAX: www.sqlbi.com/books/the-defin...
  • Věda a technologie

Komentáře • 197

  • @KA-rk9to
    @KA-rk9to Před 3 lety +23

    I loved seeing how even Alberto spends time looking for a missing parentheses and forgets the return part. I somehow feel less of an idiot now.

  • @niamhstanley4723
    @niamhstanley4723 Před 3 lety +7

    You have just helped me solve a clients requirement I have been trying to fix for over 5 months! WOW thank you!

  • @FruitfulPerspectives
    @FruitfulPerspectives Před rokem +4

    Excellent! Easy to follow, easy understand, and relatable. I'm amazed at how fast he figured out the Rank+1 miscalculation at 34:00. Great tutorial.

  • @claudiocannistraro279
    @claudiocannistraro279 Před 2 lety +3

    The value of this video is priceless! Un caloroso GRAZIE dalla Sicilia, Alberto!

  • @JohnSullivan1
    @JohnSullivan1 Před 3 lety +1

    So simple, yet so complex. Excellent Alberto!

  • @haleylearn
    @haleylearn Před měsícem +1

    I really like your way of presenting, slowly but without any gaps in knowledge for the audience.
    Everything is clear little by little, thank you very much for the useful information

  • @HachiAdachi
    @HachiAdachi Před 3 lety +14

    Truly masterful. I love peeking into Alberto's brain and see how all the pieces come together in there. A long video, but worth it! Thank you, Alberto!

  • @yiubili1
    @yiubili1 Před 3 lety +3

    That's truly a masterpiece. It's so complicated, yet you make it so understandable! Thanks very much for the video, sir!

  • @ShabnamKhan-vk7fj
    @ShabnamKhan-vk7fj Před 3 lety +2

    Thank you so much Alberto, I love how passionate you are about getting to perfection with DAX. Your love for your work is truly inspiring for your students.

  • @ytperson87
    @ytperson87 Před 3 lety +1

    Dear SQLBI team, thank you for your work. Your presentations, like this, are helping me at work.

  • @gulhermepereira249
    @gulhermepereira249 Před 3 lety +2

    Bravo! This is pure gold.
    Thank you for sharing, Alberto

  • @josepromero1452
    @josepromero1452 Před 3 lety +1

    Fantastic Alberto!
    Thanks a lot for this so useful tutorial. Not only to learn more about DAX, but also for its application to the customers requirements.

  • @marcsimpson6443
    @marcsimpson6443 Před 3 lety +1

    Fantastic Video. So helpful. I watched once, then managed to put together what I needed (Pie Chart rather than matrix) using your technique and it worked perfectly. You explained each step so well.

  • @decentmendreams
    @decentmendreams Před 3 lety +4

    Hi Alberto, this was actually very easy to follow up and the fact that you did it in PBI desktop helped a lot. I followed your instructions and got the results I wanted right away. You are so awesome! Thank you so much!

  • @ZappPSR
    @ZappPSR Před 3 lety +1

    Thanks Maestro Alberto for the video. This demo shows how important logic and creativity are to good coding.
    Knowing DAX combined to logic and creativity as you said can solve any scenario you encounter!

  • @mohammed333suliman
    @mohammed333suliman Před 3 lety +2

    As always great stuff,
    I like the way of providing outlines in the beginning of the video and showing organized breakdown of how you are going to solve the problem.
    As always great lesson from great teacher.
    Thank you Alberto
    Thank you SQLBI team.

  • @robbieausman1337
    @robbieausman1337 Před 3 lety +2

    Alberto once again knocks it out of the park. I was asked by my Exec to do this very thing in December 2020, I wasn't finding very helpful instruction elsewhere, Alberto's step by step instruction were great.

  • @davidirias3459
    @davidirias3459 Před 3 lety +1

    Greeting from Central America, I'm learning a lot with each video. Thank you

  • @comunidax968
    @comunidax968 Před 3 lety +1

    Congrats Alberto and team, It is noticeable the production quality.

  • @IoanSendroiu
    @IoanSendroiu Před rokem +1

    Your videos are the best videos I've ever seen.
    Many many thanks for all your work.

  • @OneNI83
    @OneNI83 Před 9 měsíci +1

    First it seems like "Mission Impossible",but Alberto cracked it. Excellent.

  • @srinivaskandru5034
    @srinivaskandru5034 Před 3 lety +1

    Tension mounts up in a live workshop after a satisfactory search of a good 30 secs for the missing part, experienced the same bermuda spot many times as a trainer. No matter how great you are, it happens for everyone..
    I have expected a sophisticated formula for this calculation (coz many new functions were born after 2018 in PBI), but still so many nuts and bolts needed for this Top N products after so many years of product lifespan, I am talking abt Top N.
    But some DAX patterns were changed i.e budgeting and Basket analysis after the advent of new functions..coz I still remember watching the good old days of Budgeting in Power Pivot and Power BI in the 2015/16, tens of times for good understanding.. Thanks Alberto..meet you one day in India..

  • @Bharath_PBI
    @Bharath_PBI Před 3 lety +1

    This is exactly what I did in my previous project, the small change was, instead of making placeholder for others row in the middle, we placed at the end by counting distinct products +1 , then row visible filter logic was to show all products rank

  • @mytubeview
    @mytubeview Před 3 lety +1

    I been spending hours to try to solve this problem! Thanks for this video!

  • @vincentdusk2383
    @vincentdusk2383 Před 3 lety +1

    Brill! Thanks for giving that fantastic solution.
    Not that easy, but I was able to recreate everything and I will present it to my fellow colleagues soon.
    It is always a pleasure watching your informative and useful vids.
    Cheers, Vin aka Pia

  • @Ibraheembinmehmood
    @Ibraheembinmehmood Před 2 lety +1

    This video is so useful. Thank you so much for this.
    Special Thumbs Up for the way you explained the whole Technique.

  • @benignoguilarte2806
    @benignoguilarte2806 Před 3 lety +1

    Alberto you are a master!!! great video, I spent a lot of time thinking about the logic used to solved the problem and this is just excellent, easy to understand once you follow your recommendations. Thank a lot please to continue creating sensational videos as this one

  • @tonandaya7414
    @tonandaya7414 Před 5 měsíci +1

    Wow.... excellent ! ... solved what i want to do in my management report , step by step on how to do it ... Perfect !

  • @TheLeotLion
    @TheLeotLion Před 2 lety +1

    Excellent handwriting, great solution ( thank you for the video ! )

  • @andrewwalker5974
    @andrewwalker5974 Před rokem +1

    Another great video from Alberto. Thanks!!! it's pretty awful the lengths we need to go to to work around Power BI's shortcomings. I'm having to use Power BI now because my company has moved away from QlikView. In a QlikView dashboard you can select a Top N as a static or user variable qty and the visuals' properties have a lovely checkbox to "include others" and QlikView just does it - in a split second, no further coding, lots of time saved to do something productive instead.

  • @kabilraj746
    @kabilraj746 Před 3 lety +1

    Breaking complex requirements into smaller pieces makes it easy to understand. Looking for more videos ..

  • @davidturbucz5776
    @davidturbucz5776 Před 3 lety +1

    A very useful and understandable topic! Thank you! Time to start the book!! :)

  • @barttrudeau9237
    @barttrudeau9237 Před 3 lety +1

    that was amazing and inspiring! I'll be watching again and practicing

  • @khardu
    @khardu Před 3 lety +1

    OOOhhh ... a heavy dose of DAX!
    Thank you Alberto, cool report.

  • @ballajaja
    @ballajaja Před 3 lety +1

    Thank you for the detailed explanation. This helped a lot!

  • @marcinkaczmarczyk4406
    @marcinkaczmarczyk4406 Před 3 lety +1

    Awesome video Alberto! You've done my life much easier. Cheers!

  • @peterbogdanovich4043
    @peterbogdanovich4043 Před 3 lety +1

    This is better then a Ferrari, it is Sleek and awesome like a Ferrari and yet it is available on you tube for free.
    Alberto you are GOOOOOOOD!

  • @szlim3829
    @szlim3829 Před rokem +1

    A very very good video, thanks for sharing your insights and methods on making this customization.

  • @jameszhou162
    @jameszhou162 Před 3 lety +1

    Just practiced it with my dataset. it works like a charm. love the contents and i am reading thru your book as well. thanks.

    • @SQLBI
      @SQLBI  Před 3 lety

      Good to know it works for real! :)
      Thanks for sharing it.

  • @migmanc
    @migmanc Před 3 lety +1

    Amazing video, thanks a lot. I am learning so much in your channel.

  • @erikaivanauskiene5284
    @erikaivanauskiene5284 Před rokem +1

    Thank you very much for this great tutorial!

  • @dayhi011
    @dayhi011 Před 2 lety +1

    Thank you for this video. It has been very helpful!

  • @Usuario-gk1ni
    @Usuario-gk1ni Před 2 lety +1

    Thank you so much... you are a truly teacher

  • @3danim8r1
    @3danim8r1 Před 2 lety +1

    WoW......I have seen that video thrice to understand the concept.....Thank you so much for sharing your knowledge👍👍👍....

  • @minimalman24
    @minimalman24 Před 3 lety +1

    Thank you very much Alberto. Very good as always

  • @azadabulkalam2998
    @azadabulkalam2998 Před rokem +1

    Simply Love it sir. Excellent job.

  • @hlambert100
    @hlambert100 Před 2 lety +1

    Thank you very much, good, good, ideas and resolution is perfect.

  • @emmanuelgq
    @emmanuelgq Před 3 lety +1

    Thank you, it works perfectly! I had to twek the formulas a little because my project works with YTD :)

  • @zeisslaimen1
    @zeisslaimen1 Před 3 lety +1

    as always, I have to watch 2 times. Love u, Alberto :)

  • @kennethsimon1902
    @kennethsimon1902 Před 3 lety +1

    Excellent tutorial. Really helped me a lot

  • @ImranAhmed-vl5po
    @ImranAhmed-vl5po Před 2 lety +1

    Thank you so much Alberto. be blessed

  • @juandavila41
    @juandavila41 Před 2 lety +1

    Excelente video, genial la utilización de los parámetros para volver el TOP dinámico y genial la manera como se resuelve por medio del condicional del rankin la fila "otros" para las visuales.
    Muchas gracias.

  • @pufick925
    @pufick925 Před 11 měsíci +1

    Cool. I've done my project by your video :D Thanks a lot

  • @danilocampana
    @danilocampana Před 3 lety +1

    Thank you Master, very didactic class!!

  • @2404Pepe
    @2404Pepe Před 2 lety +1

    VERY USEFUL!!! Thanks Alberto!!

  • @jaimemejia4387
    @jaimemejia4387 Před 3 lety +1

    Awesome, it definite takes reports to the next level. It´s difficult but it worths.

  • @engvictorfarias
    @engvictorfarias Před 2 lety +1

    Amazing, Alberto. Thanks for sharing your knowledge with us 💕💕🥰🥰. Come to Brazil and bring Marco too. 😁😁.

  • @1yyymmmddd
    @1yyymmmddd Před 3 lety +1

    Great and very clear ! Thank you.

  • @TheERIERI31
    @TheERIERI31 Před 3 lety +1

    Great thank you for all videos

  • @venkateshkumar5197
    @venkateshkumar5197 Před 3 lety +1

    Thanks a lot Sir for the detailed explanation

  • @DanielADamico
    @DanielADamico Před 3 lety +1

    Awesome video! You're amazing!

  • @kryptonets
    @kryptonets Před 3 lety +6

    Truly Genius, Alberto! Thank you very much and Marco for all your work. I started studying DAX two years ago with SQLBI and your patterns. I wanted to ask if it is possible to use MDX inside PowerBI, I sometimes use it creating named sets in Excel and was wondering if you know any features or secrets about it. 🙂

  • @tibobago
    @tibobago Před 3 lety +1

    Thanks Alberto. I know what my team is going to work on today :-)

  • @user-ze4xc6tu4f
    @user-ze4xc6tu4f Před rokem +1

    Great video thanks!

  • @mortens5266
    @mortens5266 Před 3 lety +2

    Thank you for another excellent and educational video! These are really appreciated!
    After watching the first video on the TopN function in DAX Studio, I had the same thought as the other viewers like you mention in the start of the video 0:49..
    Though this video was excellent, what I am "missing" is link between the complex query in DAX Studio and Power BI. How do I, step by step, code piece by code piece, move my query from DAX Studio to a useful measure in Power BI?
    If you could make a video on this it would take the understanding of DAX for a lot of us DAX developers to a whole new level.

  • @thellfowler688
    @thellfowler688 Před 3 lety

    Your videos are top notch! Its not just the knowledge but your presentation of it is essentially flawless. Great content, great audio, great video (using the stream deck :thumbsup:) and doing the on-screen inking is the cherry on top!
    I have to ask, since I'm currently in the market, what's the tablet you are using for that (and app if you needed one)?

    • @albertoferrari6893
      @albertoferrari6893 Před 3 lety +1

      Thanks. I am using a Samsung Galaxy Tab S7+ with Noteshelf as the software (but the sw to draw depends on the video I record). It is then connected through USB and mirrored using scrcpy. The main drawback is that you need a picture to draw on, therefore you need to capture it in advance.

  • @epinedoh
    @epinedoh Před 3 lety +1

    Muy inteligente profe. Gracias!

  • @ezekiel0606
    @ezekiel0606 Před 3 měsíci +1

    this is amazing. I thought you were writing it on the spot. regardless, genius

  • @eric_vieira
    @eric_vieira Před 3 lety +2

    Eu sempre fico maravilhado com podemos voar apenas com alguns minutos de conhecimento de qualidade!
    Como sempre digo: "Aprenda algo novo todo dia". Esse foi meu novo de hoje.
    VAleu!!!! #powerbinareal

  • @mshparber
    @mshparber Před 2 lety +1

    Great, Alberto! I would add a little change: 1. If there are less products that TopN, then no need for Other, so it should return BLANK() and not zero (at least in my scenario).
    Thanks!

  • @KaterynaYakubovska
    @KaterynaYakubovska Před 3 lety +1

    Great video!

  • @jayeshsuthar9198
    @jayeshsuthar9198 Před 2 lety +1

    Great tutorial

  • @anilyadav-rt4sr
    @anilyadav-rt4sr Před 3 lety +1

    It's wonderful for me👍 thanks

  • @BernardoNunes7
    @BernardoNunes7 Před 2 lety +1

    Numero uno, grazie mile

  • @Lhen134
    @Lhen134 Před 2 lety +1

    Great video thanks

  • @powerbinareal
    @powerbinareal Před 3 lety +2

    Sempre TOP!

  • @vishalpawashe9487
    @vishalpawashe9487 Před 3 lety +1

    Brilliant!!

  • @TiltTeamMafia
    @TiltTeamMafia Před rokem +1

    tnx very much! awesome!

  • @saikrishnach777
    @saikrishnach777 Před rokem +1

    Brilliant!

  • @user-kl5ii6eb5d
    @user-kl5ii6eb5d Před rokem +1

    thank you very much

  • @yanakurenkova401
    @yanakurenkova401 Před měsícem +1

    Amazing!

  • @f.xaviervicedo6486
    @f.xaviervicedo6486 Před 3 lety +1

    a masterpiece!

  • @gilbertosegoviano7701
    @gilbertosegoviano7701 Před rokem +1

    You are amazing 🎉

  • @stephenbrincat7124
    @stephenbrincat7124 Před 3 lety +1

    Thanks Alberto, as always very well explained
    Ideally would have the year as a column in the matrix, so one could compare the rankings over the years 🤔🤔

  • @monicagomez2944
    @monicagomez2944 Před 3 lety +1

    Thank you

  • @AkhtarHussain-ct2hr
    @AkhtarHussain-ct2hr Před 2 lety +1

    Thank you so much for the excellent video, very well organized and presented. One suggest, if I may make, please please make the size of your curser larger or make it transparent, I had difficulty following where you were clicking.

  • @prashantkushwahavlogs
    @prashantkushwahavlogs Před 3 lety +1

    You are awesome.

  • @rushgreen5861
    @rushgreen5861 Před 3 lety +1

    You are amazing 🤩

  • @gopichand5017
    @gopichand5017 Před 3 lety +1

    Super , very useful

  • @yijieqiu3104
    @yijieqiu3104 Před 3 lety +1

    Fantastic..

  • @shyambhadresa
    @shyambhadresa Před 2 lety +2

    very useful vid! I would like to group up the blank values with the 'Others'. How would I achieve this?

  • @ajitkancherla9594
    @ajitkancherla9594 Před 2 lety +1

    awesome 👏👏👏👍👍👍👍

  • @Hdcqt751
    @Hdcqt751 Před rokem

    He is a master, but this difficulty level for creating just Others shows how MS Power BI has a profound problem. Tableau solves this dynamic issue with a click!

    • @SQLBI
      @SQLBI  Před rokem

      Yes, this is a workaround until Power BI implements a specific feature in the UI!

  • @hongngocnguyen8806
    @hongngocnguyen8806 Před rokem +1

    Top notch video! Thanks a lot for this. I have a question tho. Instead of a Whatif table to generate N values, I limited the slicer to show top 5,10,20 and 30, and all worked well. However, I also want to add an “All” option to the slicer, when I choose which all the data will be displayed in the matrix, sorted descendingly. I’ve been trying to solve this for a while but couldn’t. Do you have any suggestion? I’m very grateful for any help.

  • @dariuszspiewak5624
    @dariuszspiewak5624 Před 3 lety +1

    Alberto, instead of assigning a dynamic rank to the "Others" item, you could take the absolute max from the TOPN table, add 1 to it, and assign this to the "Others" item as the rank. This way you don't have to think too much about the arithmetic and it'll work just as fine. Of course, in the measure that governs the display of the rows you'd need to just add an OR condition to account for the "Others" row. And the ranking could still be used for sorting. The basic idea here is to assign the (max of the TOPN table + 1) to the "Others" item. If you still don't want to think too much, just assign plain 10000 to "Others" as its rank and account for this in the row-filtering measure as before using OR. Sorting will work fine again.

    • @SQLBI
      @SQLBI  Před 3 lety +1

      Did you measure its performance? We don't think it would change the performance much, and the code would be very similar - but we might be wrong!

  • @janwillemvanholst
    @janwillemvanholst Před rokem +1

    Great video. Very educational. I think the Top3Prods at 27:00 is unnecessary, it is already down to these top product (and others but the value is zero in this stage).

  • @arnohoedelmans
    @arnohoedelmans Před 3 lety +2

    Great Video Alberto.
    I have a question. I add the customer name to the rows. I can't understand why i am getting rows with no sales. What should be changed to not show those rows?

  • @emiljanik3078
    @emiljanik3078 Před 2 lety +1

    Thanks Alberto for very helpful tips. One question about Ranking measure - why you didn't use [TopN Value]+1 instead of 4 in IF( IsOtherSelected, [TopN Value]+1... This way you can filter not only TOP 3 but TOP N products.

  • @MrVishu125
    @MrVishu125 Před 2 lety +1

    Hello Alberto, this was awesome and thanks, I have one last question, If I want to display the information in a chart instead of a table, how do I sort the data in a graph similar to the table view. ? please do help me with an answer.

  • @georgianamocanu8560
    @georgianamocanu8560 Před 7 měsíci

    Hello! I have tested this and it’s really great. However I have tried to use another type of visual: bar chart/column chart and it seems that it doesn’t work as expected. Is this approach working only for matrix/table or am I missing something? Thank you!😊