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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors