Forum Discussion
Inquiry about Suitable Visual
- 4 years ago
alvin199 Thanks for the sample data - I misunderstood your post and thought you were giving the desired result when you were actually giving the source data.
Power BI works best with a nice database structure, so your source data needs to be unpivoted. I have done this in the sample file attached below signature. You can do this in Power Query. Click the Student column > Transform tab > Unpivot other columns. Rename Attribute to Course.
Then you can follow my instructions much easier without the need to create a separate measure for each subject.
If you don't unpivot the columns, your measures can work but it's much more manual. You need to use SUM instead of COUNT. I've done this for the No. of Art measure for you only (because the Unpivot is better way to go):
Hopefully that all makes sense?
alvin199 Thanks for the sample data - I misunderstood your post and thought you were giving the desired result when you were actually giving the source data.
Power BI works best with a nice database structure, so your source data needs to be unpivoted. I have done this in the sample file attached below signature. You can do this in Power Query. Click the Student column > Transform tab > Unpivot other columns. Rename Attribute to Course.
Then you can follow my instructions much easier without the need to create a separate measure for each subject.
If you don't unpivot the columns, your measures can work but it's much more manual. You need to use SUM instead of COUNT. I've done this for the No. of Art measure for you only (because the Unpivot is better way to go):
Hopefully that all makes sense?
That is what I expect.
I am using the Transpose method and find it unable to cater my request. Eventually, Unpivot did the job well.
In short, Power BI expects all the data with the same kind store in a single column.
Thanks for the advise.