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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

I need a way to count without adding columns

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.