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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Data_enthu
New Member

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.