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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors