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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Alex_ds
Frequent Visitor

count under text column in a table

Hello Everybody,

 

An easy question, how can I add count under a text column in a table? 

Captura.PNG

 Thanks so much¡

1 ACCEPTED SOLUTION

Hi @Alex_ds ,

 

Maybe we can create an index column to work around instead of using the Product.

Index = CALCULATE(DISTINCTCOUNT('Table'[Product]),FILTER('Table','Table'[Product] <= EARLIER('Table'[Product])))

 

Then we can update the measure as below and work it out.

Measure = 
VAR pro =
    MAX ( 'Table'[Product] )
RETURN
    IF ( ISFILTERED ( 'Table'[Index] ), pro, COUNT ( 'Table'[Product] ) )

2.PNG

 

Pbix as attached.

 

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Alex_ds ,

 

We can create a measure as below to work around.

Measure = 
VAR pro =
    MAX ( 'Table'[Product] )
RETURN
    IF ( ISFILTERED ( 'Table'[Product] ), pro, COUNT ( 'Table'[Product] ) )

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi v-frfei-msft,

It works correctly, thanks so much¡

Anyway, it just works if column "Product" is in the Table. Is there any chance it works if column "Product" is not in the table?

 

Grettings,

 

Alex

Hi @Alex_ds ,

 

Maybe we can create an index column to work around instead of using the Product.

Index = CALCULATE(DISTINCTCOUNT('Table'[Product]),FILTER('Table','Table'[Product] <= EARLIER('Table'[Product])))

 

Then we can update the measure as below and work it out.

Measure = 
VAR pro =
    MAX ( 'Table'[Product] )
RETURN
    IF ( ISFILTERED ( 'Table'[Index] ), pro, COUNT ( 'Table'[Product] ) )

2.PNG

 

Pbix as attached.

 

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
AilleryO
Memorable Member
Memorable Member

Hi,

 

My first thought is make a measure :

Number Of Producto = COUNTA([Producto])

But to display it only on the bottom line of your table is another question, may be just two tables with superposition ?

Hope it helps

 

Olivier

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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