This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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.
Hi,
The problem could be much simpler to solve if we use the "Unpviot Other Columns" feature in the Query Editor. To receive further help, share some data, explain the question and show the expected result.
Ashish,
The question is: is it possible to create a formula (m-code most likely I guess) that can search column headers that contain the current year value?
And if I could show the expected result, then I wouldn't need to make the post...because I would've figured it out! lol.
Say I have some headers that look like this in the screen shot.
And I want a formula that can look at the header names and find those headers that contain the current year in them.
Hi,
I am convinced that "Unpivoting other columns" is the way to go.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 28 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 29 | |
| 20 | |
| 19 |