Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Klaudiusz
Regular Visitor

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. 

Klaudiusz_0-1706713876963.png

Klaudiusz_1-1706714103120.png

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 3
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

Gayatri_D05
Resolver II
Resolver 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.
Gayatri_D05_0-1706717878609.pngGayatri_D05_1-1706717937380.png

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. 😊

 

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.