Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kpaul
Regular Visitor

How to select X axis and group by column dynamically

Hi all,
I need help in below usecase.
I am building a report in Power BI (migrating analytical web application to Power BI).
- Data source is Snowflake and using direct query.

- Data table has 37 millions of records.
Usecase is-
- Show data table and charts with measures for different dimensions. Charts are like current balance vs date or loan amount vs date grouped by fico score, or some other measure vs product category grouped by lender.
Basically the requirement of the application would be-
- There are multiple slicers for selecting records. (which is easy to achieve)
- There is one slicer to select x axis ( This is tricky. I found some tutorials that suggest to use UNPIVOT, which does not work in my case. With direct query and given the huge number of records, DAX cannot returen the resultset).
- There is one slicer to select group by column. User can select one or multiple columns (This is also tricky. Though it can be achieved through creating multiple sumarized tables and UNION them together to make a result set, this allows user to select only single group by column at a time)
- User should have flexibility to select which measure (one or multiple) they want to select. (This is also somewhat achievable through SWITCH case)

 

Can anyone help me to achieve above mentioned functionality in Power BI?
Is it at all possible to dynamically select X axis (dimension) not using UNPIVOT (convert columns to rows)?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kpaul , If you need to change axis, Then one option is bookmark and button

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

Another option in case of direct query

https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/

 

or unpivot , which not suitable for your data

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kpaul , If you need to change axis, Then one option is bookmark and button

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

Another option in case of direct query

https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/

 

or unpivot , which not suitable for your data

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Amit, I appreciate your time for writing the answer.
I considered the options you have mentioned.
first option- I tried it earlier, but I have created bookmarks for other measures and there are 15-20 options, that creats confusion
second option- binding slicer selection with parameter worked. I had to download latest power bi desktop vesrion ( It wasn't working initially as I was using older one). This worked like magic. Thank you.
I will accept this post as solution. I hope it'll help others as well.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.