Forum Discussion
Crosstab visualization with dynamically changing columns
dfarkas , You need to unpivot the columns and they will become row values, You can use them in the slicer and matrix column.
refer if needed
Dynamically change chart axis in Power BI
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/
Thanks, amitchandak.
This was the first solution I tried and unfortunately this doesn't suit my requirements. The main problem is that this is an additive solution and does not do any cross-tabulation.
This is the output from this solution (N = 10):
Column 1 Count
cat 3
dog 7
Column 2
male 5
female 5
Total 20
Instead, I'm looking for an output like this:
Column 1 Column 2 Count
cat male 2
cat female 4
dog male 1
dog female 3
Total 10