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
prajwal1
Frequent Visitor

Display total no of customers in totals and customer names in column of table visual

Hey guys, I need to display the customer names as a column in table visual and count of cutomers in the Totals of the same column just like below. Please help me with some ideas. Thanks in advance.

 

RowCustNames
1A
2B
3C
4D
Total4
2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @prajwal1 
You can try

CustNames =
IF (
    ISINSCOPE ( 'Table'[Customer Name] ),
    SELECTEDVALUE ( 'Table'[Customer Name] ),
    DISTINCTCOUNT ( 'Table'[Customer Name] )
)

View solution in original post

tamerj1
Super User
Super User

Hi @prajwal1 
Please refer to attached sample file withthe proposed solution

1.png

CustNames = 
IF (
    HASONEVALUE ( 'Index'[Row Number] ),
    MAXX ( 
        FILTER ( 
            ADDCOLUMNS ( 
                VALUES ( 'Table'[Customer Name] ),
                "@Rank", RANKX ( ALLSELECTED ( 'Table'[Customer Name] ), 'Table'[Customer Name],, ASC )
            ),
            [@Rank] = VALUES ( 'Index'[Row Number] )
        ),
        'Table'[Customer Name]
    ),
    DISTINCTCOUNT ( 'Table'[Customer Name] )
)

View solution in original post

8 REPLIES 8
tamerj1
Super User
Super User

Hi @prajwal1 
Please refer to attached sample file withthe proposed solution

1.png

CustNames = 
IF (
    HASONEVALUE ( 'Index'[Row Number] ),
    MAXX ( 
        FILTER ( 
            ADDCOLUMNS ( 
                VALUES ( 'Table'[Customer Name] ),
                "@Rank", RANKX ( ALLSELECTED ( 'Table'[Customer Name] ), 'Table'[Customer Name],, ASC )
            ),
            [@Rank] = VALUES ( 'Index'[Row Number] )
        ),
        'Table'[Customer Name]
    ),
    DISTINCTCOUNT ( 'Table'[Customer Name] )
)

Hello @tamerj1  ,

 

Your solution is just perpect but I have another level of difficulty would be great if you can suggest. 
Table Details.pngIssue.png


In the table I have measure value as well which is giving wrong value with CustName column. 
Can you help !!


Hi @poojadc_i 
You can do the following:

1.png

tamerj1
Super User
Super User

Hi @prajwal1 
You can try

CustNames =
IF (
    ISINSCOPE ( 'Table'[Customer Name] ),
    SELECTEDVALUE ( 'Table'[Customer Name] ),
    DISTINCTCOUNT ( 'Table'[Customer Name] )
)

This is working when the original column is there in the table. How can I do this without using that column in the table.?

@prajwal1 
Which column are you going to use in the table? Or you you want to see the result on a card visual? Please clarify 

Not in a Card. I want to display in a table visual like I mentioned in my question.

I want to display Customer names in a column and the total number of customers in 'Totals' in table visual without using the original column in the table.

The above Dax expression working when the original column is also available in the table visual. I don't want to use that column. I will use the measure only

@prajwal1 

I understand, but there must be some column placed there in the table. Such solutions cannot be straightforward as it should provide a workaround over this property of power bi table. I'll be back to office shortly. Let me see what can I do. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.