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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Jeanxyz
Power Participant
Power Participant

create a dynamic column header based on measures

I have created a timesheet matrix table as below. the current column field is Intl week number (e.g., 13, 14,15...). I need to populate the start date of each week into the column header, something like "week14 - 4/4/2022". Is there a way to populate this value to the column header. 

It's easy to populate this data in a table, but I have to use a matrix table here, hence there is an issue. 

timesheet header.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jeanxyz ,

 

Please create a calculated column in the calendar table.

 

Week_Date = 
VAR _weeknum =
    WEEKNUM ( 'Calendar'[Date], 2 )
VAR _firstdate =
    CALCULATE (
        MIN ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar'[Date] ), WEEKNUM ( 'Calendar'[Date], 2 ) = _weeknum )
    )
VAR _result = "Week" & _weeknum & "-" & _firstdate
RETURN
    _result

 

Then use this column as a field of the matrix column.

vcgaomsft_1-1655979324837.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

4 REPLIES 4
Jeanxyz
Power Participant
Power Participant

Thank you! Your solution worked. I had forgotten to accepted it as a solution though. 

mh2587
Super User
Super User

Week Start Date/Wk No = CONCATENATE(Data[Date] – WEEKDAY(Data[Date],2) + 1,Intl week number)
//try this one


✔ Answered? Mark as solution

Muhammad Hasnain | Super User • Fabric • Power BI • Data Engineering

Let's connect on LinkedIn
Jeanxyz
Power Participant
Power Participant

The thing is I can't drag a measure into the column field. I have create a tooltip page to show weekstart data. Maybe someone has a better solution. 

Anonymous
Not applicable

Hi @Jeanxyz ,

 

Please create a calculated column in the calendar table.

 

Week_Date = 
VAR _weeknum =
    WEEKNUM ( 'Calendar'[Date], 2 )
VAR _firstdate =
    CALCULATE (
        MIN ( 'Calendar'[Date] ),
        FILTER ( ALL ( 'Calendar'[Date] ), WEEKNUM ( 'Calendar'[Date], 2 ) = _weeknum )
    )
VAR _result = "Week" & _weeknum & "-" & _firstdate
RETURN
    _result

 

Then use this column as a field of the matrix column.

vcgaomsft_1-1655979324837.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.