Power BI - Conditional columns
647 views
Oct 18, 2024
Power BI - Conditional columns Watch more Videos at https://www.tutorialspoint.com/videotutorials/index.htm Lecture By: Mr. Akshay Magre, Tutorials Point India Private Limited
View Video Transcript
0:00
Hello friends and welcome to Tutorials Point
0:03
In this video we are going to see how to create conditional column in Power BI desktop
0:09
Now our major focus out here would be how to create conditional column and what are the usage of it
0:15
Now as per the name, as the name suggests itself, a column which is based on certain condition
0:21
You must be familiar with the if condition. If this is the condition, what should be my answer and if that is not the condition, what should be my answer
0:29
The conditional column works in the same way in Power BI desktop
0:33
We just need to put in the proper arguments and we need to put the proper condition
0:38
and it automatically gives me the result in the new columns. It will automatically fulfill the condition and it will automatically fill in the values as well
0:48
Now it is not necessary that only one condition needs to be met. We can apply multiple conditions for the same column and get the results accordingly
0:56
So how to create this conditional column, and what are the usage of it will be having a better understanding of it in our practical approach
1:04
Hello friends and welcome In this video we are going to see how to create conditional column in Power BI So let get started off In order to create a conditional column we need to get to the Power Quedy Editor which can be easily fetched by clicking on this Edit Query button The moment you click on this button a Power Query editor will open up All right so let get started off We will go to this particular query that is a geographical query in which we can see the locations of different we can see the location of our customer and the respective country that they belong to
1:40
Alright, so now in order to create the conditional column, we have to go under the add column tab and under add column tab we have something called as conditional column
1:50
Let's click on it. The moment you click on it, another window pops up right in front of you, which asks you the very first thing that what should be the name of the column which needed to be added, right
2:02
So before I get started off, let me tell you what is a conditional column, a column which has been created upon certain condition
2:09
we can apply certain condition to create that particular column what do I mean by
2:14
that we have to run a rule and when the rule is run the column that has been
2:19
created will be evaluated on what the rule that we have applied all right
2:24
so let go ahead and first change this column name and we will name this as customer location all right now what we are going to do depending on which country they belong to we will
2:38
going to evaluate whether they are regional or whether they are expats or outsider
2:43
all right so let's get started off so if you go under this column name it starts with
2:49
an if so basically it's similar to the if condition that we see in our excel screen as
2:54
well if the condition is true what should be the output and if the condition is
2:58
false what should be the output all right so let's go ahead and start it off
3:02
so I will I have already given the name that is a customer location and under
3:07
this column drop down menu I will simply click on country as I want to see
3:12
whether which country it belongs to so if the country equals to let's say
3:18
USA so the output should be that the customer would be as simple as that and in order to add a new rule I simply click on add so we
3:29
have this else if again I'll run a rule that country which equals to let's say
3:34
France all right and if I click here what should be the answer so I'm telling
3:40
the conditional column that if the country equals to if you can see France get me the real answer as an outsider all right and if not otherwise it will be like others so
3:55
so basically if it's from USA it should be regional if it's France it's
4:01
outsider and the rest of them would be others so let's go ahead and hit okay and
4:05
see what happens the moment I hit okay out here do you see there's a new column
4:10
which has been created in which you can see that if the customer belong to France
4:16
he's an outsider and if you click on this drop-down menu which gives me the list
4:20
of all the entries as you can see the list is not complete I ask him to load
4:25
more so you can see I have all the regions I have others outside and region so
4:30
if I want to check who are the original so I'll simply cross-check this others and
4:34
outside and simply hit okay so directly we get all the region which belong to
4:40
USA and we get which are the customers which are regional as of now so it is very simple in order to run a rule
4:47
We have to go to the conditional column and under that we can see what other things that we can do
4:53
All right so this is a very basic thing that we can do under conditional column
4:58
Hopefully guys understood this video see you until next time
#Business & Productivity Software