Data structure-
Column 1: Date
Column 2: Value Year
Column 3: Value Month
Column 4: Activity Name
Now there is a filter "Month" on the dashboard.
Scenario 1: When selected "ALL" - Latest month value from "value year" column
Scenario 2: When selected "one month" - That particular month value from "value Month" column.
Solution required- Need a calculated field which works on the Month filter.
Hi @Aahuti Rathor
To create a calculated field that adapts based on the "Month" filter selection, you can use the following approach:
- **Create a Parameter for Month Selection**: This parameter will allow users to select a specific month or choose "All" to view data for the latest month.
- **Create a Calculated Field**: This field will check the value of the "Month" parameter. If "All" is selected, it will return the value from the "Value Year" column for the latest month; otherwise, it will return the value from the "Value Month" column for the selected month.
Here's an example of how you might write this calculated field:
IF [Month Parameter] = 'All' THEN
IF [Date] = { FIXED : MAX([Date]) } THEN [Value Year] END
ELSE
IF DATETRUNC('month', [Date]) = DATETRUNC('month', DATE([Month Parameter])) THEN [Value Month] END
END
In this calculation:
- `[Month Parameter]` is the parameter where users select a month or "All".
- `[Date]` is your date field.
- `[Value Year]` and `[Value Month]` are your respective value fields.
This calculated field will display the appropriate value based on the user's selection in the "Month" filter.
Best regards,
Olga Ignateva