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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors