ALLSELECTED Function in Power BI | DAX for ALLSELECTED()

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone my name is bindu in today's video we'll talk about all selected function in power bi to understand all selected function let's compare it with all function this all function it is used to ignore or exclude the filters for a visualization whereas on selected function it picks up only the filters that you selected confused let's quickly look into an example to understand it better if you see my screen here i have this report in which i am getting the total sales for each product and total sales irrespective of the product and the sale percentage so here the total sales is the total sale value for each product and the sales all this column we created this using all function this column will be the total value of all the products if you see the total sale denominator here the total value this will be repeated in all the rows here and the sale percentage is total sales divided by sales or this is the sale percentage and the sale percentage we have 100 percent for all the products and for all countries if you don't know how we created the sales all column you can find it in all function video and that is in the description box below and now what we are doing is we are trying to select a country here i am selecting the country canada so if you look at the sale percent here the percent is 20.96 which is not right so when you select the country canada the denominator has to be the total sales for only canada only for that country so the denominator has to be the total sales for whatever country we selected that means like we have the same value here for all the rows that way we should have this 24 this value to be repeated on all the rows here to calculate the sale percent for the countries to do that we use all selected function let's see how we do that i am creating a new measure here and i'm giving the measure name as sales all selected and starts with calculate and i want to filter total sales here it's the same like we did for the all function except that we use all selected instead of all all selected and um i want the product and i'm using product fill here let's see what this does i'm bringing in the newly created measure sales all selected into the table okay now you see the difference you have this value repeated on all the rows in sales or selected column i choose canada and france so this value this denominator is repeated in sales all selected so now if we create a measure for sales percent including total sales and sales all selected columns we get the right percentage let's see that as well i'm creating a new measure here and i'm naming it as [Music] all selected sales present and this would be divide total sales and sales all selected right okay i'm applying this measure now and i'm bringing in this here okay so now we have sales all selected percentage as well and we have hundred percent here whereas the sale sets whereas the sale percent which is using sales all it has only 41 percent so this all selected it is considering the values for the filters we selected and ignoring the remaining ones so it's including the filters for canada and france because we selected these filters and it is ignoring the counts and it is ignoring these filters germany mexico and united states because we haven't selected them i hope this is clear now just to recap all function it ignores all the filters whereas all selected it picks up the filters you selected and ignores the ones which you haven't selected i hope now you understood why we use all selected function and what is the use of it if you have any questions on all function or all selected functions please ask them in the comment section below and i'll try to answer all of them if you like this video please hit the like button and please do subscribe to my channel if you haven't yet and in the next video i'll be talking about all except function so please stay tuned
Info
Channel: The Hima Bindu
Views: 11,058
Rating: undefined out of 5
Keywords:
Id: 6FWh5gsRB-k
Channel Id: undefined
Length: 5min 49sec (349 seconds)
Published: Wed Jan 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.