How to change datetime field aggregate using filter?

Hi community,

I have a line chart with x-axis showing date. Now I want to change aggregations of x-axis using filter/control. If a user wants to see day relative data, then date on x-axis is aggregated by day. If they want to see weekly data, then they could choose Week in filter and data is automatically aggregated weekly. Same goes for Month, Quarter and Year. Is there any way of achieving this?
Thanks in advance.

image

Regards,
Raghu Pratap Singh

Hi
using drill down user can change to day month, quarter.

Hi
The other way around is this.
create a parameter with default value (day).

ifelse(
${Periodstarting}=‘Day’,truncDate(“DD”,{ Date}),
${Periodstarting}=‘Month’,truncDate(“MM”,{ Date}),
${Periodstarting}=‘Quarter’,truncDate(“Q”,{ Date}),
truncDate(“YYYY”,{ Date})
)

Use this field in visual and use this filter on sheet.

Thanks @Shahid_Muhammad
This solution worked for me.

1 Like