Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi there 🙂
I want to be able to change the column name referenced in a DAX formula - for example here I want to be able to change the column name where it says "YTD", so that this is based on a slicer selection
Its easy enough to change the other values (e,.g. I made a formula that uses a slicer input instead of the hard coded "Turnover" value in the above formula...but I'm wondering if its possible to also make the column name in square brackets a variable?
Is this possible?
Thank You!!
Alex
Solved! Go to Solution.
@Anonymous Not exactly within the square brackets, but you could try a SWITCH function to get the result you're after:
Here's an example I made up:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks very much for this! Yes I was able to work around this using the SWITCH function.
Thanks again
Alex
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous Not exactly within the square brackets, but you could try a SWITCH function to get the result you're after:
Here's an example I made up:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
I know I'm a Very Late to the party. But is it feasible to obtain the pbix example file that does this?
don't worry , I find it how to do it ? 🙂
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |