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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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