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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
gtanya33
New Member

Getting data to show subcategories

I am extremely new to PowerBi (this is the first dataset I'm trying to pull in).  The issue I'm running into is that my dataset has the count of students enrolled for each of our emphasis areas and then it has columns that show the semester and the year as a subcategory.  How do I pull this data in so that we can then look up trends for that particular emphasis area.

 

gtanya33_0-1654701157703.png

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @gtanya33 ,

According to your description, you want to use Power BI do some analysis with the data structure you showed.

I create a sample.

vkalyjmsft_0-1655100241855.png

Here's my solution.

In Power Query, after getting data, it display like this:

vkalyjmsft_1-1655100657124.png

1.Select Use First Row as Headers, get this:

vkalyjmsft_3-1655100867880.png

2.Select all the Year column at the same time, then click Unpivot Columns.

vkalyjmsft_4-1655100982321.png

Result:

vkalyjmsft_5-1655101041466.png

3.Add a custom column.

vkalyjmsft_7-1655101193106.png

 

Semester = if Text.Contains([Attribute],"_")then "Winter" else "Fall"

 

Result:

vkalyjmsft_6-1655101155047.png

4.Split the year column by "_"

vkalyjmsft_8-1655101352275.png

5.After remove the unneeded column and rename columns, get this table:

vkalyjmsft_11-1655101756943.png

Now, you can use a line chart to display the trend of each emphasis or a matrix to show the data.

vkalyjmsft_12-1655101804482.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @gtanya33 ,

According to your description, you want to use Power BI do some analysis with the data structure you showed.

I create a sample.

vkalyjmsft_0-1655100241855.png

Here's my solution.

In Power Query, after getting data, it display like this:

vkalyjmsft_1-1655100657124.png

1.Select Use First Row as Headers, get this:

vkalyjmsft_3-1655100867880.png

2.Select all the Year column at the same time, then click Unpivot Columns.

vkalyjmsft_4-1655100982321.png

Result:

vkalyjmsft_5-1655101041466.png

3.Add a custom column.

vkalyjmsft_7-1655101193106.png

 

Semester = if Text.Contains([Attribute],"_")then "Winter" else "Fall"

 

Result:

vkalyjmsft_6-1655101155047.png

4.Split the year column by "_"

vkalyjmsft_8-1655101352275.png

5.After remove the unneeded column and rename columns, get this table:

vkalyjmsft_11-1655101756943.png

Now, you can use a line chart to display the trend of each emphasis or a matrix to show the data.

vkalyjmsft_12-1655101804482.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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