Forum Discussion
Custom x-axis within filter context
Hey together,
is there any way within DAX or Power BI to customize the x-axis in a column chart?
I have a column chart with categorical values on the x-axis like "A", "B", "C", "D" and DISTINCTCOUNT values on the values. There are 2 slicers on the dashboard. With the filtercontext/combination of the 2 slicers, the x-axis reduces to "A","B","C", so "D" is exluded, that is correct.
However I would like to show "D" also in the same column chart/report with an individual measure.
Is that possible to manipulate the x-axis, while keeping the two slicers?
Best Regards
Hi Anonymous ,
According to your description, I create a sample.
Here's my solution.
1.Create a new table, don't make relationship between the two tables.
Category Table = VALUES('Table'[Category])2.Create a measure.
Sales Measure = IF ( MAX ( 'Category Table'[Category] ) IN VALUES ( 'Table'[Category] ), MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Category Table'[Category] ) ), 'Table'[Sales] ), 0 )Put the category column from the new table in the Axis and the measure in the Values, get the result.
Here, if you want the category D display other values instead of 0, you can directly modify the 0 part in the measure.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
According to your description, I create a sample.
Here's my solution.
1.Create a new table, don't make relationship between the two tables.
Category Table = VALUES('Table'[Category])2.Create a measure.
Sales Measure = IF ( MAX ( 'Category Table'[Category] ) IN VALUES ( 'Table'[Category] ), MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Category Table'[Category] ) ), 'Table'[Sales] ), 0 )Put the category column from the new table in the Axis and the measure in the Values, get the result.
Here, if you want the category D display other values instead of 0, you can directly modify the 0 part in the measure.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.