Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 ? 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |