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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
JarrellCo
Regular Visitor

Dynamic Column Header Search

I am wondering if it is possible to create a formula (m-code most likely I guess) that can search column headers that contain the current year value, then use that columns data to evaluate/compare with other data I have in other columns for the current year.
I have column headers that have 2023, 2024 and soon to have 2025...and want to only evaluate data for 2023...but I want to set the report up dynamically enough to adjust based on the current year. This way, when we roll into a new year, the bi report adjusts and uses data from the 2024 column(s).
I'm sure with the word Power in Power BI means it can do this! I just need some guidance on making it happen! I know you geniuses out there can help guide me through this please!
Thanks in advance.

1 REPLY 1
Ahmedx
Super User
Super User

pls see my video

https://1drv.ms/v/s!AiUZ0Ws7G26RiTLPE9O8q4GBdd5_?e=HSQB11

Date.Year( Date.From( DateTime.LocalNow()))

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.