Forum Discussion
Dynamic Axis/Category based on slicer
My question: is it possible to have a dynamically changing axis on a visual?
Lets say I have a slicer tied to 'Table1'[MonthBuckets] that has values of 3 Months, 6 Months, 12 months. This is tied to a funnel visual with a "values" option of "Phone Calls" (that always stays the same), and then a "Category" (also called axis in bar charts) option that needs to change between "3 Month Categories", "6 Month Categories", and "12 Month Categories" based on the selected option from the slicer. These three options are all there own column in my data set, not values.
- Anonymous4 years ago
Hi grayscg ,
We can't put the measure on the category/axis field. And if you want to get a calculated column, it will not change according to the user interaction(slicer, filter, column selections etc.) in the report as the value of a calculated column is computed during data refresh and uses the current row as a context... Please review the following links about the difference of calculated column and measure...
Calculated Columns and Measures in DAX
Calculated Columns vs Measures
Best Regards
4 Replies
- HoangHugo
Solution Specialist
Hi, try this one
Measure1=VAR SelectedValue = SELECTEDVALUE('Table1'[MonthBuckets])RETURNIF(SelectedValue = "3 Months", SELECTEDVALUE('Table2'[3 Month Categories]),IF(SelectedValue = "6 Months", SELECTEDVALUE('Table2'[6 Month Categories]),IF(SelectedValue = "12 Months", SELECTEDVALUE('Table2'[12 Month Categories])))- grayscg
Advocate I
This is probably closer but does not allow me to use this measure in a chart. I guess it is just returning text, not the column itself? I am not sure but it does not allow to put the measure in the axis/category portion of a visual
- AnonymousNot applicable
Hi grayscg ,
We can't put the measure on the category/axis field. And if you want to get a calculated column, it will not change according to the user interaction(slicer, filter, column selections etc.) in the report as the value of a calculated column is computed during data refresh and uses the current row as a context... Please review the following links about the difference of calculated column and measure...
Calculated Columns and Measures in DAX
Calculated Columns vs Measures
Best Regards
- danextian
Super User
Hello,
Have you tried using field parameters? https://www.sqlbi.com/articles/fields-parameters-in-power-bi/