I am trying to count number of IDs that exist as of a particular date (see Summary tab). However, since the dates (column A) in raw data tab are in UTC timestamp format, the formula returns 0.
My formula is countif('raw data'!A:A,"<="&A2)
How do I adjust the formula to convert UTC timestamps to datevalue within countif function.
I also would like to make this countif function work with arrayformula so that I don't have apply the formula on each row.
Here is the sample sheet :
https://docs.google.com/spreadsheets/d/1IFAAiguhKD0xK8SYsnzMBSar4IFAQPzZfIh0U44bZWI/edit?usp=sharing
Translate first your dates by
=arrayformula(if(A2:A="",,VALUE(left(A2:A,10))))
You can use
=sumproduct(('raw data'!D:D<=A2)*('raw data'!D:D<>""))
Now, if you want arrayformula to be applied, first make a query
=QUERY('raw data'!A:D,"select D,count(B) group by D")
then compute a total as following
={"Total ID";ArrayFormula(if(isblank(G2:G),,mmult(1*(transpose(row(G2:G))<=row(G2:G)),1*G2:G)))}
both formulas are on yellow cells
Related
I want to convert below google sheet formula to arrayformula, please guide.
=MAX(0,if((G3\>0)\*ISNUMBER(G3), MINUS((today()-K3),SUM(EOMONTH(K3,0)-K3,10)),G3))
I want to convert this in array
basically k3 is a last date that i want to substract from todays date in a list
You should add ranges instead of specific cells. So it should be something like this:
=ARRAYFORMULA(IF((G3:G>0)*ISNUMBER(G3:G),(today()-K3:K)-((EOMONTH(K3:K, 0)-K3:K)+10), G3:G))
I have a recordset where rows have a date field.Rows are from current year and last year. I want to see the count of rows per year. That's easy. Now I'd like to have a third column with difference (count(currentYear) - count(lastYear)). Is there any way to achieve this?
thanks
It seems like you want to have the difference calculated between two members of the same date field.
If so, you might want to consider the customizeCell() API call to retrieve the count values of each year, use them to calculate the difference, and modify the necessary cells with the result.
Alternatively, you could try modifying your data set so that the lastYear and currentYear are two different fields – this, for example, would allow you to compare them within a calculated value.
My company has tasked with slicing the information on turnover and to create different graphs.
My source data looks like this: Relevant columns are: Voluntary/Involuntary, Termination Reason, Country, Production, and TermDateKey
I am trying to get counts using different filters on the data. I managed to get the basic monthly total using the formula:
Term Month Count = GROUPBY('Turnover Source','Turnover Source'[TermDateKey],"Turnover Total Count", COUNTX(CURRENTGROUP(),'Turnover Source'[TermDateKey]))
This gave me a new sheet with the counts for each month.
Table that shows TermDateKey on Column 1, and Counts on column 2
I am trying to add onto this table by adding counts but using different filters.
For example, I am trying to add another column that gives me the monthly count but filtered for 'Turnover Source'[Voluntary/Involuntary]=="Voluntary". Then another column for 'Turnover Source'[Voluntary/Involuntary]=="Involuntary" and so on. I have not found anywhere that shows me how to do this and when I add in the FILTER function it says that GROUPBY(...) can only work on CURRENTGROUP().
Can some one point me to a resource that will give me the solution I need? I am at a loss, thank you all.
It looks like you may not be aware that you don't have to calculate all possible groupings with DAX formulas.
The very nature of Power BI is that you use a column like "Termination Reason" on an X axis or in the legend of a visual. Any measure that you have created on values of another column, for e.g. a count of all rows, will then automatically be calculated to be grouped by the values in "Termination Reason", giving you a count of each of the values in the column.
You do NOT need DAX functions to calculate the grouping values for each measure for each column value combination.
Here is some simple sample data that has been grouped into dates and colours, one chart showing a count of each colour and one chart showing a sum of the Value column. No DAX was written for that.
If your scenario is different, please explain.
I have a table within Power BI that has a date field, and a value field. I am filtering on this date field, using a slicer, to sum all of the value data before the specified date. I would like to get this date value to use in a LOOKUPVALUE() elsewhere (to get a conversion rate).
Is there a way to accomplish this?
I have tried the DAX functions that return the values of a particular table/column with filters preserved but this never seems to work, and just returns the entire dataset, e.g. VALUES(), FILTERS(), ALLEXCEPT().
Any help would be greatly appreciated!
I found a solution using measures.
The DAX for future reference:
Filter Date = CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
I have a column of dates, column C, and a column of values, column G. I want to be able to calculate monthly totals of column G. I've poked around and found that you can use sumif or you can use a filter. The filter method seems easier. I've tried the following but it doesn't work.
=sum(filter(C3:C365,G3:G365>date(3/1/2016),G3:G365<date(3/31/2016)))
How can I check the dates in column C and then sum up the values from column G?
Thanks Rich
Try:
=sumproduct(MONTH(C2:C) = 3,B2:B)
Three is the month number (March).