Forum Discussion
Slicers
1. I have created New Parameter for "Year,Half Year,Quarter & Month" as Named as "Year Toggle" & visual it as slicer;
2. Secondly ,i need to add another slicer as Named as "Month" ,
while chosing Year - Need to shows Month along with Years [eg Apr'20]
Half Year - Need to shows maximum year of maximum months -[Half year]
Quarter -Need to shows maximum year of maximum Quarter Year months -[Quarter]
Month - Need to shows maximum year of maximum months -[Month]
While chosing New parameter Slicer, second Slicer need to function dynamically!
I am not able to understand by your description what second filter will represent just a number of days or something else.
would you please try this method I hope this would help you to create your custome date range filter.
https://www.youtube.com/watch?v=JLupF1j49wo
I hope I answered your question!
2 Replies
- Uzi2019Community Champion
I am not able to understand by your description what second filter will represent just a number of days or something else.
would you please try this method I hope this would help you to create your custome date range filter.
https://www.youtube.com/watch?v=JLupF1j49wo
I hope I answered your question!
- saud968Memorable Member
Try this
Create the “Month” Slicer:
Add a new slicer for the “Month” field.
Create a Supporting Table:
Create a table that includes all the combinations of Year, Half Year, Quarter, and Month. This table will help in dynamically filtering the data based on the selection in the “Year Toggle” slicer.
Create Measures for Dynamic Filtering:
Create measures to dynamically filter the “Month” slicer based on the selection in the “Year Toggle” slicer. Here are some example measures:
SelectedYearToggle = SELECTEDVALUE('Year Toggle'[Year Toggle])MaxMonth =
CALCULATE(
MAX('Date'[Month]),
FILTER(
'Date',
'Date'[Year] = MAX('Date'[Year])
)
)MaxHalfYear =
CALCULATE(
MAX('Date'[Month]),
FILTER(
'Date',
'Date'[Half Year] = MAX('Date'[Half Year])
)
)MaxQuarter =
CALCULATE(
MAX('Date'[Month]),
FILTER(
'Date',
'Date'[Quarter] = MAX('Date'[Quarter])
)
)MaxMonthOverall = MAX('Date'[Month])
Use the Measures in the “Month” Slicer:
Use the measures created above to dynamically filter the “Month” slicer. You can use a SWITCH statement to apply the correct measure based on the selection in the “Year Toggle” slicer.
DynamicMonthFilter =
SWITCH(
TRUE(),
[SelectedYearToggle] = "Year", [MaxMonth],
[SelectedYearToggle] = "Half Year", [MaxHalfYear],
[SelectedYearToggle] = "Quarter", [MaxQuarter],
[SelectedYearToggle] = "Month", [MaxMonthOverall]
)Apply the Dynamic Filter:
Apply the DynamicMonthFilter measure to the “Month” slicer to ensure it updates based on the selection in the “Year Toggle” slicer.
Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!