Forum Discussion
dynamic x-axis based on filter
- 2 months ago
Hi alops194
are you looking for a solution similar to this ?
you can follow this tutorial to get a dynamic x axis https://www.youtube.com/watch?v=hilfglpKNRQ
I have attached a sample I created so you can play around with it and get it working as needed.
alops194 Hey,
Create a Date Calandar using below dax.
Calandar =
ADDCOLUMNS(CALENDAR(DATE(2010,1,1),DATE(2030,12,31)),
"Month year", FORMAT([Date],"Mmm-YY"),
"Month sort",FORMAT([Date],"YYYYmm"),
"Week Year","Week " & WEEKNUM([Date], 2) & FORMAT([Date],"-YY")
, "Week sort" , FORMAT([Date],"YYYY")& WEEKNUM([Date],2)
)
2 - Mark this new table date table
3 - Create relationship between Date table and Fact table .
4) Create a Field parameter.
5) Select your Month year and Week Year from Date table abd rename it as per your choice.
7- Add it as slicer and drag it in your viz X axis like below image
😎 Then you can use above slicer to switch in between Month year and Week year as per choice
9) Sort it as per your requirement and use Month sort and week sort column to sort asc or desc order.
Thanks
Harish M
If this is your soultion then Kindly give Kudos and accept it as solution to help other community member.
- alops1942 months agoFrequent Visitor
Hi, thanks for your reply, but unfortunately this solution is not suitable for my needs. The change from month to week must be done dynamically, therefore without using a slicer.