Forum Discussion
Help Making Column Headers (Dates) Dynamic in PBIX
- 5 months ago
Hey, mjsystemss ; you can do this nicely with field parameters with no additional setup (except the field parameters).
Result would look like this:
First, create the measures you need:
Then create a Field Parameter:
Give it a name and put the measures there (just put anything really, you can modify it later):
Then go to Data pane; check out the new Field Parameter table and modify if it like this:
Adjusted order and replace the Text string of the names of Today/LastWeek measures as I have.
Dynamic_Matrix_Headers = { (FORMAT(TODAY() - 7, "dd-MM-yyyy"), NAMEOF('Fact_Activity'[Measure_Lastweek]), 0), ("Weekly_Activity", NAMEOF('Fact_Activity'[Measure_WeeklyActivity]), 1), (FORMAT(TODAY(), "dd-MM-yyyy"), NAMEOF('Fact_Activity'[Measure_Today]), 2), ("Percentage(%)", NAMEOF('Fact_Activity'[Measure_Percentage]), 3), ("Total_Amount", NAMEOF('Fact_Activity'[Measure_TotalAmount]), 4) }Then put the Field Parameter's column to your Matrix:
The name will probably be different, but it doesn't matter.
Then you'll get this:
Attaching PBI, so you can test it yourself.
Hi mjsystemss
can you please show images? That will explain better what you are looking for, which is unclear to me
Thanks
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
I want headers encircled to display as dates