Pivot table period : Automatically display daily data for the previous month

Hi everyone,

I’m working on a DHIS2 project where daily data is entered, and I would like to display a dynamic report that shows daily values for the previous month directly in a dashboard.

Goal:

  • Automatically update a Pivot Table each month to show daily data for the previous month, one row per day.
  • The report should be added to the dashboard and refresh automatically without requiring manual date selection.

Context:

  • Data is entered daily through a Data Set (aggregated data), not via a program or event capture(yeah I know it weird :sweat_smile:).
  • I’ve tried using relative periods like LAST_MONTH, but these only return monthly aggregated values, not a breakdown by day.
  • Manually selecting each day of the previous month works, but it’s not practical for an automatically updating dashboard.

Questions:

  1. Is there a native way in DHIS2 to display daily breakdowns of the previous month in a visualization?
  2. If not, what are the best practices or workarounds recommended by the community?
  3. Is this feature planned for a future release of DHIS2?

Thanks in advance for your help and suggestions :folded_hands:

Hi @waongo

Would it work if you use the Day date period?

Hi, thanks for your reply. But last 30 days does not really suit my needs. Imagine we are today April 22, last 30 days will include data from march 23 to April 21. What I want is data from start to end of march only (the last month: march 01 to march 31)

1 Like

Yes, sorry I don’t think there’s an out of the box solution to this; however, what about using dashboard filter and selecting “Last 60 days” (however, using the dashboard filter you will be able to limit it to the current month).

Thanks!

1 Like

Ok I see, then I’ll go with the filtering option and propose it to the end users.

Thanks a lot.

1 Like

You’re welcome! Please feel free to provide feedback in this post if you face any challenges.

Finally, if this is resolved, please mark the post that contains the solution as a solution. :folded_hands: Thanks!

Dear @waongo

Sorry about this issue, I think what would work for your use case is “Days this Month” which is not part of the relative periods under Days as shown here for Months

We can put a jira improvement request

1 Like

Right :+1:t5: “Days this month” and “Days last month”.

How the jira improvement request work ?