Forum Discussion
Add column values to filter without unpivot
- 3 years ago
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.
Then you can achieve something like this...
See attached example PBIX.
- 3 years ago
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.
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.