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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-stephen-msft
Community Support
Community Support

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors