cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors