 Hey guys, welcome to SSUnit Tech social this side and today we are going to see one of the real time interview question and answer. So recently one of my friend has attended interview on PwC. So this question was asked on PwC. So what is the question? So here let me quickly show the data set. So in this data set we can see the sales data. So like the sale order ID, date, customer ID, quantity, value, country and city. So mainly we are having this value. Let me quickly go and try to understand the requirement. So the requirement is very straightforward. Here we have this metric table and under this metric we are having the aggregated data on the country level and under that country we are having the data for the cities. So the requirement is we can see the quantity is the first column after the country and city then the next column will be the value. The third column that we need to write some DAX formula to create this table column and in this column if we can go under the aggregated level which is the country level then we will see the value on that column. Once we will go under the city level then we should see the quantity instead of the value. So like the single column is going to treat as the multiple like the aggregate level it is showing the values and on the city level it is showing the quantity. So how we can achieve this? So for that we are required to write the DAX formula and need to create one measure. So let me quickly go into another power way report and here we do not have any measure. So let me try to create a new measure. So in this measure we are going to use the sum formula and has one value. So these two formula we are required to use. So first we need to understand about the has one value. So what is the has one value? Let me call this measure as has one value and here we can see the formula which is has one value. So has one value we need to specify the column name. So let me quickly try to specify the city. So what this will do? This will be going to check on the row basis if any city is available and only a single city should be there. If the city is there then it will return true otherwise this formula will return false. So let me try to drag and drop here. So as we can see here the first row which is returning false, the second which is on the city is returning true. Similarly we can see the below as well for the aggregated level that is the country mainly. So it is running false otherwise true. So let me try to create one more measure and on that measure we will be going to check if this value is false then we need to display values. If it's true then we need to write the quantity. So let me quickly call this as calculation value. So here we need to check so we need to write the if condition. If has one value of the city is true. If it's true then we need to return the sum of the quantity. If that value is false then we need to return the sum of value and then we can close the bracket. So this is very straight forward formula. So you can remember like has one value is very important. So it is checking on the row basis and if a single value of the given column is there then it will return the value otherwise it will return the false. So as we can see here the aggregated level is returning false and on the city level because we are getting the only single cities so that's why it is returning true. So let me try to use this after this has one value. So now we can see we have achieved what we have discussed. If we can go here on the country level then we can see the value. Once we drill down on the city level then we can see the quantity. A single column is having multiple behaviors so that we have seen. So this is very important and most of the interval is asking this question. So thank you so much for watching this video see you in the next video.