Reply
Data_enthu
New Member
Partially syndicated - Outbound

How to retrieve value from a single column into multiple columns

Hello,

 I have a query output where I am getting columns such as enrollment count, CRS_SUBJ_CD (course subject code),CRS_NBR (course subject number), TERM_CD etc. 

The output has all the CRS_SUBJ_CD,CRS_NBR in 2 columns.

Data_enthu_2-1682541783507.png

 

Below is the snippet I am trying to recreate in PBI but struggling to get the enrollment numbers for Cross listed course. PS- Crosslisted course are same as CRS_SUBJ_CD,CRS_NBR.

Data_enthu_1-1682541525853.png

 

I really appreciate if someone provides any lead.

 

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

Syndicated - Outbound

Hi @Data_enthu ,

 

Do you want to count by CRS_SUBJ and CRS_NBR grouping?

Here's an example.

37.png

You can use group by feature in Power Query. Select the both columns and click "Group By...".

vstephenmsft_0-1682651219097.png

In addition to adding a column with a count, add a column that retains the original rows.

vstephenmsft_1-1682651262614.png

vstephenmsft_2-1682651320480.png

Expand it.

vstephenmsft_3-1682651328721.png

vstephenmsft_4-1682651346995.png

   

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Data_enthu ,

 

Do you want to count by CRS_SUBJ and CRS_NBR grouping?

Here's an example.

37.png

You can use group by feature in Power Query. Select the both columns and click "Group By...".

vstephenmsft_0-1682651219097.png

In addition to adding a column with a count, add a column that retains the original rows.

vstephenmsft_1-1682651262614.png

vstephenmsft_2-1682651320480.png

Expand it.

vstephenmsft_3-1682651328721.png

vstephenmsft_4-1682651346995.png

   

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

 

 

Data_enthu
New Member

Syndicated - Outbound

I am getting the count for CRS_SUBJ_CD and CRS_NBR but getting same count for CROSS_LIST_CRS_SUB_CD and CROSS_LIST_CRS_NBR in PBI 

 

Data_enthu_0-1682542188985.png

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)