Forum Discussion
Dynamic Date Switching between Month/Quarter/Year
Hi everyone,
I'm building out a report that requires me to be able to switch between seeing my base measure at the current month compared to the prior month by default - but then also switch between seeing the current quarter vs prior quarter, and then current year vs prior year.
And then the user should be able to also see any specific month/quarter/year in the past as well if they so choose. So the user can select the Month parameter and March 2022, so March 2022 will be the Current Period and February 2022 will automatically be the Prior Period. Or the Quarter parameter and Q2 2022 so Q2 2022 will be the Current Period and Q1 2022 will be automatically be the prior. And lastly Year parameter and 2022, 2022 will be the Current Period and 2021 will be the Prior Period as examples.
I made 2 mockups with Month selection and Quarter selection if that helps.
Let me know if any of this is confusing and I can try to provide more mockups. I have the base measure down correctly, it's just the data comparisons and the parameter that I'm having issues with.
Thanks!
2 Replies
- Greg_Deckler
Community Champion
kprom Use a Field Parameter as the x-axis in your line chart (Modeling tab | New parameter | Fields). You could also use that in a SWITCH statement for the measures in the Card visuals.
- kpromNew Member
Greg Very helpful thank you! If I want all the meaures to be MTD/QTD/YTD with corresponding prior periods, would i structure that switch statement?
So for example if we are looking at the report today and the user selects:
- Month
- Current Period: 1/1/2023 to 1/4/2023
- Prior Period 12/1/2022 to 12/4/2022
- Quarter
- Current Period: 1/1/2023 to 1/4/2023
- Prior Period: 10/1/2022 to 10/4/2022
- Year
- Current Period: 1/1/2023 to 1/4/2023
- Prior Period 1/1/2022 to 1/4/2022
Thanks again!
so for example selecting month would be looking at 1/1/23 to
- Month