Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
LordGrim
Contributor III
Contributor III

KPI - show count for last 30 days

Hi,

Simple thing.

I have a KPI from charts and just want to show the total count of 'Date Created' for the last 30 days and then another the count on the previous 30 days.

I have this at the moment: 
Count({<[Date Created]*={'11/02/2020'}>}[Date Created]) But this only shows for the one date.
Any direction on this gratefully accepted.

Thanks

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY'))<=$(=Date(Today(1), 'DD/MM/YYYY'))"}>} [Date Created])

I missed closing parenthesis when I posted this expression above. You can see the evaluation of your set analysis right underneath

image.png

 

View solution in original post

11 Replies
sunny_talwar

You can try this for last 30 days from today

 

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY')<=$(=Date(Today(1), 'DD/MM/YYYY')"}>} [Date Created])

 

 

LordGrim
Contributor III
Contributor III
Author

Thanks very much...does not seem to work? thinking something in the syntax?
I did use your script and changed it to UK date format .

Count({<[Date Created] *= {">=$(=Date(Today(1) - 30, 'DD/MM/YYYY')<=$(=Date(Today(1), 'DD/MM/YYYY')"}>} [Date Created])

sunny_talwar

Changing it to UK date format did not help?

NitinK7
Specialist
Specialist

hi,

you can try this

 

Count({<[Date Created]*={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}>}[Date Created])

 

Thanks,

Nitin.

LordGrim
Contributor III
Contributor III
Author

Thank you - that works but gives me the count of only 30 days ago for that day - I need the count for all up to the last 30 days.

Big thanks

NitinK7
Specialist
Specialist

can you please check again

Count({<[Date Created]*={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}>}[Date Created])

LordGrim
Contributor III
Contributor III
Author

Thankyou - this produces a zero 0? Cannot quite see the problem 😞

NitinK7
Specialist
Specialist

can you give us some sample data file

LordGrim
Contributor III
Contributor III
Author

This is a working sample of the data:
Thanks


Unqualify *;

[Date Table Created]:
LOAD * INLINE
[
"Date Created"
15/02/2020
16/02/2020
17/02/2020
18/02/2020
19/02/2020
20/02/2020
21/02/2020
22/02/2020
23/02/2020
24/02/2020
25/02/2020
26/02/2020
27/02/2020
28/02/2020
29/02/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
01/03/2020
08/03/2020
09/03/2020
10/03/2020
11/03/2020
12/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
13/03/2020
14/03/2020
15/03/2020
16/03/2020
17/03/2020
18/03/2020
19/03/2020
20/03/2020
20/03/2020
21/03/2020
22/03/2020
23/03/2020
24/03/2020
25/03/2020
26/03/2020
27/03/2020
28/03/2020
29/03/2020
30/03/2020
31/03/2020


](delimiter is ',');