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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
bzeeblitz
Helper IV
Helper IV

How to get count of specific column in the table

I have column po# where I need to check count of this column such that how many times it has been occurred 

2 ACCEPTED SOLUTIONS
DataNinja777
Super User
Super User

Hi @bzeeblitz ,

 

To calculate how many times each value in the po# column has occurred, you can use either a measure or a calculated column in Power BI, depending on your requirements.

If you need the count to update dynamically based on filters in your report, you can create a measure. The measure can be written as follows:

Po# Count = COUNTROWS(FILTER('poitem', 'poitem'[po#] = SELECTEDVALUE('poitem'[po#])))

This measure counts the number of rows where the po# value matches the selected value in the report, making it responsive to slicers and filters.

Alternatively, if you need a static count that calculates the number of occurrences for each po# in the table without being influenced by filters, you can create a calculated column. The formula for this column is:

Po# Count = 
CALCULATE(
    COUNT('poitem'[po#]),
    ALLEXCEPT('poitem', 'poitem'[po#])
)

This calculated column computes the total count of each po# while grouping by the po# column and ignoring other filters in the table. Depending on whether you need a dynamic or static result, you can choose the appropriate approach.

 

Best regards,

View solution in original post

Kedar_Pande
Super User
Super User

@bzeeblitz 

Measure:

PO Count Measure = COUNTX(FILTER('Table', 'Table'[po#] = MAX('Table'[po#])), 'Table'[po#])

 

View solution in original post

2 REPLIES 2
Kedar_Pande
Super User
Super User

@bzeeblitz 

Measure:

PO Count Measure = COUNTX(FILTER('Table', 'Table'[po#] = MAX('Table'[po#])), 'Table'[po#])

 

DataNinja777
Super User
Super User

Hi @bzeeblitz ,

 

To calculate how many times each value in the po# column has occurred, you can use either a measure or a calculated column in Power BI, depending on your requirements.

If you need the count to update dynamically based on filters in your report, you can create a measure. The measure can be written as follows:

Po# Count = COUNTROWS(FILTER('poitem', 'poitem'[po#] = SELECTEDVALUE('poitem'[po#])))

This measure counts the number of rows where the po# value matches the selected value in the report, making it responsive to slicers and filters.

Alternatively, if you need a static count that calculates the number of occurrences for each po# in the table without being influenced by filters, you can create a calculated column. The formula for this column is:

Po# Count = 
CALCULATE(
    COUNT('poitem'[po#]),
    ALLEXCEPT('poitem', 'poitem'[po#])
)

This calculated column computes the total count of each po# while grouping by the po# column and ignoring other filters in the table. Depending on whether you need a dynamic or static result, you can choose the appropriate approach.

 

Best regards,

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors