#4 DAX Fridays! 101: What is Context transition in DAX?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so hello everybody this Friday says I'm from the backs Fridays and your decks mention every Friday in today's hacks functions we're going to talk about context transition which is quite interesting topic when it comes to bags you're ready let's get started okay so I left the previous video with a question I showed you that if you put calculate around sound you will get a different result on calculate colors don't worry we will go through it in detail and I ask you why in this head context transition that was right answer but what is context transition so that's what we're going to find out today today what we're going to use is the same that we did before we have a list of products sales discount and we're going to build this from the beginning so what we're going to do is first create a measure that will calculate the sum of sales as a measure so you come on work with me some us measure and then we're just going to do some sales nothing else so some and then I wrapped the sales there and this is the intuitive part of Dax that interval T is not as intuitive as it looks you have to know how it works but this is what we're going to do I'm going to put something you've seen this time probably a thousand one time and then you put a table and it give us 800 so you will go back to how our table looks you can see it here 500 plus 100 plus 1 200 800 great so it's given us a total now if I put in our product suddenly there's some changes so why does it change well each row is acting as a filter on some so it's not now giving us a total of sales is actually giving us the total sales for in like sale on the first row because this is a filter it's like if you write some product equal seal that that would be this so here we have Kumu and here we have Jessica Brad is right to hear it it's like calculate the sum of sales product equal kissing around that's what it's given us row by row and it is an intuitive thing because you see it but the fact of the matter is that some [Music] accept roses filters as a filter context so when the drop in something it does that it just changed the value for the rows that you have because David he sees it a filter son sees that as filters know you were going here now we go to new column we are going to do the exact same thing but in a calculated color okay so we go in there and we put some as calculated column equal to exactly the same thing some and then we put sales and what do you think is good to give us for answer and that's probably what you wouldn't expect especially if you come from the Excel world this is something that's real all the times I mean you know really frustrating to be honest so what's going on here you would probably expect to see the same as here two hundred one hundred and five hundred it's actually given us eight hundred everywhere and the thing with these is that some requires filters in order to change to something other than the totals like he's so before but this is a table this have no filters at all there are no filters apply in this table whatsoever in here because this is a virtual table that it was created on the fly when I put products those hard filters but in here some is not receiving any filter so it goes here to the first row and it said gives me the photos I I have no filters and then I say oh then I'll give you the total so it doesn't see the Rose because rosanoff not filters and some does not have any filter context built-in in a new row context so it cannot see what's in the room so when I put calculate in here and then enter you can see that it give us the same result as before and that's more what we expected so what happened what did calculate do that song couldn't do on its own and here's the thing calculate does context transition both calculate and calculate table do that and what it basically means is that it takes gesso Cabrales the first row and it converts it into a filter so it's basically creating a virtual list like this and feeding it to Samas filters it's as simple as that then it's complex as that if you what it is as simple as that so when he's only some the rows are not filters so they don't get past it some when you put calculate calculate takes every road and changes as a filter so now this is basically saying sum of sales where product equal key so Cabrales give me the results and then that's why you get 200 in there okay so that is what context transition is the purest forum obviously there are if some parts but we will talk about those in another video I just want you to feel this game experiment it's the best way to learn facts
Info
Channel: Curbal
Views: 10,036
Rating: 5 out of 5
Keywords: Power bi, powerbi, Curbal, power bi desktop, power bi tutorial, power bi training, power bi for beginners, ruth pozuelo, curbal dax fridays, curbal dax 101 #3, curbal context transition, what is context transition in dax, dax 101, dax 101 curbal
Id: 03E0f-RyRn4
Channel Id: undefined
Length: 6min 18sec (378 seconds)
Published: Fri Jun 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.