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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Count occurrences into new table: Custom Column DAX, and Joins

I am building a report of rating data. My main table has columns with different metrics and rows with Excellent, Good, Fair or Poor. I want to count the total of each rating type for each metric in a separate table.

 

Column 1          Column 2              Column 3

Excellent           Good                     Fair

Excellent           Excellent               Poor

Fair                   Good                     Excellent

Poor                  Fair                       Fair

Excellent           Good                    Good

Good                Poor                      Good

 

New table:

All Columns                Excellent Count              Good Count

Column 1                    3                                    1

Column 2                    1                                    3

Column 3                    1                                    2

 

I believe I'll need to add a Custom Column in the power query editor, but I am unsure what the DAX should be. Also, I am not sure how to join this new table to the main Fact table.

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

Hi, @Anonymous 

It's difficult to create a relationship between new table and fact table based on current fields.

Please try following step to transform data in PowerQuery.

1.unpivot these columns 

veasonfmsft_0-1665134339863.png

 

2.Group table by New column 'Attribute' and 'Value'

veasonfmsft_1-1665134381482.png

3. pivot column like below:

veasonfmsft_2-1665134504868.png

Result:

veasonfmsft_3-1665134584477.png

 

Best Regards,
Community Support Team _ Eason

 

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

It's difficult to create a relationship between new table and fact table based on current fields.

Please try following step to transform data in PowerQuery.

1.unpivot these columns 

veasonfmsft_0-1665134339863.png

 

2.Group table by New column 'Attribute' and 'Value'

veasonfmsft_1-1665134381482.png

3. pivot column like below:

veasonfmsft_2-1665134504868.png

Result:

veasonfmsft_3-1665134584477.png

 

Best Regards,
Community Support Team _ Eason

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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