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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Kanivan
Frequent Visitor

Column selection based on dropdown

have a database where the first column contains historic dates. The remaining columns all contain historic data. Each columnheader has the following structure country+number

For example us2, us5, us10, uk2, uk5, uk10

In this example there are 2 options for countries and 3 for the number. These option data is also in a table. So i can make a dropdown containing us and uk and a dropdown with 2 5 10.

 

Lets say i now select us and 5. How can i make a graph plotting the data in the column us5.

1 ACCEPTED SOLUTION
mh2587
Super User
Super User

 

Go to Power Query:

  • Transform Data in Power Query

    • Select all country-number columns (us2, us5, etc.).
    • Click Transform > Unpivot Columns.
    • Rename new columns to CountryNumber and Value.
    • Split CountryNumber into Country and Number.
  • Use Simple Filtering

    • Create slicers for Country and Number.
    • Use Value in the graph, filtering based on the slicers.

 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @Kanivan 

 

This seems like a good use case for field parameters to switch between dimensions based on slicer selections. check out the link below -

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

If this isn't what you're looking for, please provide a workable sample data (not an image), your expected result from the same sample data and the reasoning behind.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
mh2587
Super User
Super User

 

Go to Power Query:

  • Transform Data in Power Query

    • Select all country-number columns (us2, us5, etc.).
    • Click Transform > Unpivot Columns.
    • Rename new columns to CountryNumber and Value.
    • Split CountryNumber into Country and Number.
  • Use Simple Filtering

    • Create slicers for Country and Number.
    • Use Value in the graph, filtering based on the slicers.

 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Uzi2019
Super User
Super User

Hi @Kanivan 

Can you share the sample data and expected output???

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors