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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ozymandi4s
New Member

how to count occurrences in a field

good evening . I need to create a new column that tells me the number of greens that repeats the number 30 for example.

 

Example: the first record is repeated 4 times the value 30. I need that 4 in a new columnaa.png

5 REPLIES 5
HotChilli
Super User
Super User

Add a new column in Power Query:

 

List.Count (Text.PositionOf ([total_sizes],"30",Occurrence.All))

amitchandak
Super User
Super User

@Ozymandi4s , One of the way is count is

New column in power query

List.Count(Text.Split([Column], ",")) +1

 

Once you so Text.Split, you can do other List operations too

https://docs.microsoft.com/en-us/powerquery-m/list-functions

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ozymandi4s
New Member

I need a way to count without adding columns

amitchandak
Super User
Super User

@Ozymandi4s , one of the best way is to split this column into rows, but that will increase the size of the table

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I need a way to count without adding columns

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors