Forum Discussion
Dynamic Header Names in a Table visual
Hi,
I was wondering if in my scenario this is at all possible to accomplish.
What I would like to do is to create dynamic header names for my table visual that will change depending on the week number. The previous week column is a dynamic value, which i utilise in my report for filtering purposes as we only want to look into 5 weeks into the past.
Above is the final outcome I would like to achieve. As of now these header names are derived from the measure names and these will not change as we progress into the future weeks.
So for instance assuming we were in week 35 at present, week 4 would turn into week 34, week 3 into week 33 etc. and these header names would reflect that accordingly.
Hopefully it makes sense.
Thanks for your support in advance!
3 Replies
- Gayatri_D05Resolver II
Hi Klaudiusz ,
From what I understood you need the columns to be dynamic right?
I just created the following measure and added it into the matrix column part:week = "Week" &" "&WEEKNUM(Dimdate[Date])
and hence based on my date selection and data available the column changes, attaching screenshot for reference.Is this what you were looking for ?
I didnt get the previous week part. if that needs to taken in consideration could you please elaborate the requirement for me ?
I hope I was able to resolve your issue. If so please tag this as the answer to help others as well. 😊- KlaudiuszRegular Visitor
Hi Gayatri_D05 Let me elaborate on the topic.
I'm only interested in displaying 5 weeks prior to the present time in one table visual hence why I have got the "Previous weeks" column which is made out of the following formula:
Previous Weeks = SWITCH('Date'[Week Offset],0, 'Date'[Week],-1, 'Date'[Week],-2, 'Date'[Week],-3, 'Date'[Week],-4, 'Date'[Week])What I do next is build 5 different measures in the filter context of this column. One for each rolling week. Now, my goal is to utilise the columns "Previous Weeks" outputs as headers for my visuals/names for my measures.Hope that makes more sense now 🙂Please, do let me know if anymore information is required.Thanks
- Pravin_Regular Visitor
You can use a visual level filter using date column from your date table, and then use the filter type as relative then select past 5 weeks