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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bluetail
Frequent Visitor

How to filter by two criteria using column names from a table?

I have a visual like this.

 

quality_screenshot.jpg 

First, I want to be able to select by project ID, which works OK with a slicer.

Second, I also wish I could filter by Stage 0, 1...7, which are my table columns, and I want each of then to show in the title of my doughnut chart (e.g. by Stage 0, or by Stage 2). 

So I need help with filtering by Stage in addition to filtering by Project ID.

 

I have provided the link to my source excel table and  power bi file.

https://1drv.ms/u/s!AtS3DN4JGKISiBhzGCQ03ddKlNyn?e=wpYhPH

 

Thank you for any advice. I'm a beginner at Power BI.

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @bluetail ,

 

If it is this you are after, then I have a solution for you:

tomfox_0-1650716176981.png

 

 

First, we need to do some unpivoting on your table. For this, go into Power Query (Home > Transform data), mark the Stage Columns and click unpivot Columns:

tomfox_1-1650716302870.png

 

 

After, your table should look like this. 

tomfox_2-1650716332717.png

 

I also renamed the column Attribute to Stage. After click on Close & Apply

 

Back in Power BI Desktop, add your slicers Project ID and Stage:

tomfox_3-1650716467260.png

 

 

The donut chart has the following settings:

tomfox_4-1650716504829.png

 

 

The table I changed to a matrix with the following rows, columns and values:

tomfox_5-1650716557128.png

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

4 REPLIES 4
tackytechtom
Super User
Super User

Hi @bluetail ,

 

If it is this you are after, then I have a solution for you:

tomfox_0-1650716176981.png

 

 

First, we need to do some unpivoting on your table. For this, go into Power Query (Home > Transform data), mark the Stage Columns and click unpivot Columns:

tomfox_1-1650716302870.png

 

 

After, your table should look like this. 

tomfox_2-1650716332717.png

 

I also renamed the column Attribute to Stage. After click on Close & Apply

 

Back in Power BI Desktop, add your slicers Project ID and Stage:

tomfox_3-1650716467260.png

 

 

The donut chart has the following settings:

tomfox_4-1650716504829.png

 

 

The table I changed to a matrix with the following rows, columns and values:

tomfox_5-1650716557128.png

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

thank you very much. I suspected a need for pivot. I'll try it myself and then accept as a solution.

vojtechsima
Memorable Member
Memorable Member

Hi, @bluetail 
here you go but to be honest, this kinda strange design it would be way better if you could transform the Stages into rows and remodel it a bit.

I'm open to anything! wasnt sure how to model it better.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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