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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kgiboin
Helper I
Helper I

How to pivot data and do a count of occurrences

Hi

If I have a table like this in power query:

Supplier IDRegionSurvey status?
1535GermanyComplete and Up to Date
1563GermanyComplete and Up to Date
2786GermanyComplete and Up to Date
1612FranceComplete but Out of Date
2057GermanyIncomplete
4309GermanyComplete and Up to Date
3717BrazilComplete and Up to Date
1867SpainNot Submitted
4130BrazilComplete and Up to Date
4624ChinaComplete and Up to Date
4068ChinaComplete and Up to Date
3531GermanyComplete and Up to Date
2469GermanyComplete but Out of Date
2666ChinaComplete and Up to Date
4798ChinaComplete and Up to Date
4079GermanyComplete and Up to Date
1734GermanyComplete and Up to Date
4650GermanyComplete and Up to Date
1770FranceComplete but Out of Date
3047GermanyComplete and Up to Date
1605GermanyComplete and Up to Date
2635BrazilComplete and Up to Date
4223SpainComplete and Up to Date
1491BrazilComplete and Up to Date
4412ChinaComplete and Up to Date
2359ChinaComplete and Up to Date
2356GermanyComplete and Up to Date
1373GermanyComplete but Out of Date
4659ChinaComplete and Up to Date
3961ChinaComplete and Up to Date

 

 

How do i get it into this format:

 

Count of Supplier IDColumn Labels   
Row LabelsComplete and Up to DateComplete but Out of DateIncompleteNot SubmittedGrand Total
Germany51 1355
Brazil30 6 36
France63811183
Spain812 11
China28136589384
Grand Total433457813569

 

essentially i want to do a count of the supplier ID's per country for each status they are in. Please help!

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Hi @kgiboin ,
if you start the pivot-operation, and select Supplier ID as Values column, click on the advanced options below and change the default-aggregation from Sum to Count.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Super User
Super User

Hi @kgiboin ,
if you start the pivot-operation, and select Supplier ID as Values column, click on the advanced options below and change the default-aggregation from Sum to Count.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors
Top Kudoed Authors