Customer table
contains the column "Status","created_date","updated date"
ascs table
contains the column "service_station_name"
First I add new measure for "status count" by using following eqn:
Status Count = COUNT('cps customers'[status])
then a new column for "day duration" by using following eqn:
Day Duration2 = SWITCH('cps
customers'[status],"Closed",DATEDIFF('cps customers'[created_at],
[updated_at],DAY),"Unattended",DATEDIFF('cps
customers'[created_at],NOW(),DAY),"Assigned",DATEDIFF('cps
customers'[created_at],NOW(),DAY),"NotApplicable",DATEDIFF('cps
customers'[created_at],NOW(),DAY),"Open",DATEDIFF('cps
customers'[created_at],NOW(),DAY))
I need top service station name..
Conditions:
i. Consider only **closed status**
ii. Top count of **closed status count**
iii. Lowest **time duration**
Steps:
Select columns service_station_name,status,status count and day duration2
Filter the closed status from column "status".
Add TOPN filteration for "status count"
Now, I got three service_station_name where each have 5 closed status count.
And for getting the lowest "day duration2" I used ascending order
"
And for displaying the top 1 service_station_name, I chosen the CARD from
visualization and get First service_station_name.Bt I haven't got the
proper answer
Then I took last service_station_name . Here also i haven't got the
answer.
Based on the screenshot, I need "Om Sakthi Engineering" as answer.
How I get the answer? Can anybody help me!
You could actually add in another column "NewColumn", then the value would be the "Status Count" divided by "day Duration". The highest value will be the top one.
NewColumn = divide(Table1[Status Count],Table1[Day Duration])
Then you can use card visualization to pick the top one value.
Under filters, you should filter status as closed, filter the top 1 for this NewColumn.
Related
I have sales rep column, and their total sales. i am showing the results in the below matrix
so the actual value that i am trying to show from the calculated column as below.
FinalActual = if('Sales Target'[SalesRep] = "ABC",'Sales Target'[totalABC],'Sales Target'[totalseats]-'Sales Target'[totalseatspq] )
so I am trying to show the actual value based on the sales rep name. if the sales rep name is "ABC", then it should show the value of the measure which I created separately. for others it should be Sales Target'[totalseats]-'Sales Target'[totalseatspq]. But the issue here is, for ABC it's not taking the value from the "true condition(Sales Target'[totalABC])" of if statement. its still picking the value of the false condition(Sales Target'[totalseats]-'Sales Target'[totalseatspq]). Please help if I am missing anything here.
Your help is highly appreciated
I have one thing to solve.I want to add new column as "Complete or Not" deponding on Action Column.If one date have sign_in and sign_out,data in new column is "Complete" for that date.
Pls help me
enter image description here
I have a case that I want find the duration for each "state_id", by subtracting its change_time from the time just below it.
So I want to generate a new column that duplicates the column "change_time" and shifting all values one row up, so the change_time #2(in red) would come next to change_time #3(in red).
Is there a way to shift that column one row up?
After a lot of thinking and researching. I have solved it with the following steps:
Sort you columns of interest from A-Z (in my case sort: ticket_id, then history_type_id, then stat_id)
make a first new index column starting from 0 using "Index column from 0".
make a second new index column starting from 1 using "Index column from 1".
merge your query with itself using "merge query" based in the two new indices.
expand the merged query for the date column only.
Now you will have a new date column, duplicated from the old one with a shift of one row.
2)
so I have been working on automating this table for the most performing person of the week on google sheets.
now on the column O i have top candidate, I want to run an if statement that would check through the values of each person. for example, for day 1 it would check from K3 to N3 once it gets the value, it should post the name of the candidate. That means for week 1, day 1, it would check and see that charles has the top performance and post "Charles" on the top candidate cell of the same row.
so far i know how to know ts easy getting the number between the cells which has the biggest value =max(K3:N3) but then combining it with an if statement that would know the cell on top... that got me worked up and still not found an answer
This formula should work:
=INDEX($K$2:N,1,MATCH(MAX($K3:$N3),$K3:$N3,0))
MATCH will find a specific column that has the max value of K3:N3, then INDEX will reference the value of the top column.
Sample Sheet:
use:
=ARRAYFORMULA(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IFNA(
IF(IF(K3:N="", "x", K3:N)=QUERY(TRANSPOSE(QUERY(TRANSPOSE(K3:N),
"select "&TEXTJOIN(",", 1, IF(LEN(J3:J),
"max(Col"&ROW(A3:A)-ROW(A3)+1&")", ))&"")),
"select Col2"), K2:N2, ))),,9^9))))
I am new to power bi and would require your help to sort out below issue which I am facing.
Basically I am taking three columns into consideration as below:
Question: I would like to remove duplicate values from above table based on conditon "
Equal value for "Time" ,"ID" and Absolute difference in "Time spent" is lower or equal than 1"
as you can see in the image Rows highlighted falls in this category.
I would like to get these below rows removed based upon condition.
Question: I would like to remove duplicate values from above table based on conditon "
Equal value for "Time" ,"ID" and Absolute difference in "Time spent" is lower or equal than 1"
as you can see in the image Rows highlighted falls in this category.
I would like to get these below rows removed based upon condition.
I am able to perform this in excel by making us of a fourth column with formulae =IF(AND(A3=A2,B3=B2,ABS(F3-F2)<1),"problem",0) and then filtering out the rows marked as probelm. Please help!!
Regards
Mahi
I bet the suggestion from #Alexis Olson works just fine, but since you specifically mentioned the Query Editor, here's how I would do it there:
Have your data loaded like below, and just accept the changes made under Changed Type:
Don't worry about the other steps under the Query Settings. We'll get to that eventually.
Select Add Column and click Index Column, so that you get this:
Select Add Column, click Custom Column and insert this little formula in the appearing dialog box Table.AddColumn(#"Added Index", "Custom", each #"Added Index"[Time Spent]{[Index]}-#"Added Index"[Time Spent]{[Index]-1}):
Click OK, and make sure that you're getting this:
I think this step is a little weird, but you'll have to click 'Table' there in the column:
You will get an Error message in the first row, but you can remove that by right-clicking that column, and clicking Remove Errors:
Now you can click the drop-down menu in the Custom Column, select Number Filter and Does Not Equal
And insert 0, or select 0 from the drop-down menu in the dialog box:
This is it, your required numbers should now be filtered away:
Note, however, that this procedure comes at a cost since you're losing the first value due to the first step in the indexing. If the rest of this is something you can use, I can see if we can fix that last little part as well.
You can pick a representative [Time Spent] value from each unique set of rows by taking a max or min over the list of "duplicate" values. Here's the formula for such a custom column, which I'll call [Min Time]:
= List.Min(
Table.SelectRows(#"Previous Step",
(C) => (C[Time] = [Time] and
C[ID] = [ID] and
Number.Abs(C[Time Spent] - [Time Spent]) < 1)
)[Time Spent])
Once you have this custom column, you can group by [Time], [ID], and [Min Time] to roll up the duplicates and then rename the [Min Time] column to [Time Spent].