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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
harshadrokade
Post Partisan
Post Partisan

Add column values to filter without unpivot

Hi,

 

I have below table. I want to create a filter that will have values from column Subject1, Subject2 & Subject3. One option is unpivot column Subject1, Subject2 & Subject3 & then use that 'Attribute' column in slicer but I dont want to do that as other columns get repeated, increasing the size of the data.

 

How to add these three column headers in slicer & then filter their data without unpivot? Like creating a seperate table with these three column values, etc..

 

Student nameStudent Overall scoreSubject1Subject2Subject3
A63459945
B38152378
C39670943
2 ACCEPTED SOLUTIONS
KNP
Super User
Super User

Hi @harshadrokade

 

If this student data is your main fact table and not the student dimension, I'm not sure why you wouldn't unpivot the data. Power BI works better with narrow/tall fact tables.

In saying that, I obviously don't have the complete picture of your data model/requirements. 

 

Can you provide an example of how you would want the slicer to work? 

Are you wanting 'between' two values for any of the subject columns?

How is the 'Student Overall score' calculated?

 

If you could go down the unpivot path, with the assumptions I've made, I would have thought a data model more like the below would work better for you/be more performant.

 

KNP_0-1669053384817.png

 

Then you can achieve something like this... 

Student.gif

 

See attached example PBIX.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

So, I'm confident that unpivoting is the correct thing to do to the model for both performance and allowing for the simplest measure creation.

Did you review the PBIX file I attached?

 

It doesn't matter if the names were to duplicate in the detail table. Incidentally, if you have a student ID column, you wouldn't use the name in the detail table anyway.

When referencing the student name, it should be done with the column from the student dimension table which only has a single value for every student. Also, I added the overall score to the student dimension so it will not be duplicated. 

 

Please review the PBIX file I'd attached previously and let me know if there's a reason that this model design won't work with your actual data.

 

 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

5 REPLIES 5

Unpivoting the columns Subject1, Subject2, and Subject3 into a single column allows you to create a slicer without the need for a separate table.

beacuse minimizing data duplication and reducing the size of the dataset.

By using unpivot, you can efficiently create a slicer with values from multiple columns without the need for a separate table. This approach keeps your dataset clean and reduces redundancy, ensuring optimal performance in Power BI. If the increase in data size is not a concern and you prefer simplicity, unpivot remains a preferred method.

KNP
Super User
Super User

Hi @harshadrokade

 

If this student data is your main fact table and not the student dimension, I'm not sure why you wouldn't unpivot the data. Power BI works better with narrow/tall fact tables.

In saying that, I obviously don't have the complete picture of your data model/requirements. 

 

Can you provide an example of how you would want the slicer to work? 

Are you wanting 'between' two values for any of the subject columns?

How is the 'Student Overall score' calculated?

 

If you could go down the unpivot path, with the assumptions I've made, I would have thought a data model more like the below would work better for you/be more performant.

 

KNP_0-1669053384817.png

 

Then you can achieve something like this... 

Student.gif

 

See attached example PBIX.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

Thanks @KNP for your help.

 

I have a card visual where I want to see the respective subject score which name is selected into the slicer. I have two slicers as Student name & Subject. If I select Srudent A & Subject 1 in the slicers, I want to see 45. If I select Student C & Subject Subject 2, I want to see 9. The problem is how do I bring these Subjects names into one column so that I can use that column in slicer as below so that I can select them in slicer?

harshadrokade_1-1669091310645.png

 

I dont want to unpivot Subject columns as it will then create duplicate values for Student names & Overall scores as multiple rows will be for these two columns data. The one I shared is the sample data from the table but there are many more columns in the table, & unpivot will make it very heavy as all these other columns values will get repeated in every row.

 

As I dont want to unpivot the data, even if I create a seperate table for Subjects, how do I connect the that table with main table ? Asking coz I have seperate columns for each subject? Are we saying we have to anyway unpivot data after which all Subjects will come in one column & then we can use the same in slicer as filter?

 

 

So, I'm confident that unpivoting is the correct thing to do to the model for both performance and allowing for the simplest measure creation.

Did you review the PBIX file I attached?

 

It doesn't matter if the names were to duplicate in the detail table. Incidentally, if you have a student ID column, you wouldn't use the name in the detail table anyway.

When referencing the student name, it should be done with the column from the student dimension table which only has a single value for every student. Also, I added the overall score to the student dimension so it will not be duplicated. 

 

Please review the PBIX file I'd attached previously and let me know if there's a reason that this model design won't work with your actual data.

 

 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!
JorgePinho
Solution Sage
Solution Sage

I think that using field parameters might help you.

Check this out and let me know what you think: https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.