Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I want to display current month distinct count vs previous month distinct count of Product ID on KPI, Please help
Sample Date:
| Product ID | Installation Date |
| 6817 | 01-02-2017 |
| 4939 | 01-02-2018 |
| 5423 | 01-02-2019 |
| 2303 | 01-02-2020 |
| 3226 | 01-02-2017 |
| 3064 | 01-02-2018 |
| 3547 | 08-07-2020 |
| 7862 | 08-07-2020 |
| 6030 | 01-02-2017 |
| 7810 | 01-02-2018 |
| 5800 | 01-02-2019 |
| 4390 | 08-07-2020 |
| 7808 | 01-02-2017 |
| 5835 | 01-02-2018 |
| 6293 | 01-02-2019 |
| 7019 | 08-15-2020 |
| 7987 | 08-02-2020 |
Thanks
If you have a month field, it would be something like:
Count(Distinct {<Month={'$(=Month(Today()))'}>} [Product ID] ) //Current month
Count(Distinct {<Month={'$(=Month(Addmonths(Today(),-1)))'}>} [Product ID] ) //Previous month
If you have only date field(which is generally not a good data model I would say), try like:
Count(Distinct {<[Installation Date]={"=Month(today())=Month([Installation Date])"}>} [Product ID] ) //Current month
Count(Distinct {<[Installation Date]={"=Month(Addmonths(today(),-1))=Month([Installation Date])"}>} [Product ID] ) //Current month
Hi Tresesco, Thanks for your reply!!
I have a month field as well. I have tried both the way you suggest and I am getting the desired result as well but the only problem is that I have to select current year to get the result otherwise everything is fine.
Is it possible if I dont select year filter to current year and get the desired result?
Thanks
There is a problem of notification. I didn't realize that you replied.
Try something like:
Count(Distinct {<Year={'$(=Year(Today()))'}, Month={'$(=Month(Today()))'}>} [Product ID] )