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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

No of rows in a table visual

Is there any way to display No of Rows returned/displayed in a TABLE visual? 

 

Currently I have a table displaying Sales persons who have multiple sales in a month (Showing person name, number of sales). Say there are 23 Sales persons listed (i.e 23 rows in the table). Any easy way to display 23 in a KPI or card visual without writing a complex DAX query? If that can not be done, someone can help me with a query? This is similar to writing a select count(*) on a given SQL query, which is not easy in DAX.

 

Hope this makes sense.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @Anonymous

 

Use this and try it

 

Number-Persons =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Sales;
            Sales[Person];
            "NumberofSales"CALCULATE ( COUNTA ( Sales[Person] ) )
        );
        [NumberofSales] > 1
    )
)




Lima - Peru

View solution in original post

6 REPLIES 6
Vvelarde
Community Champion
Community Champion

hi @Anonymous

 

Use this and try it

 

Number-Persons =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Sales;
            Sales[Person];
            "NumberofSales"CALCULATE ( COUNTA ( Sales[Person] ) )
        );
        [NumberofSales] > 1
    )
)




Lima - Peru
Anonymous
Not applicable

@Vvelarde Thank you very much. Though not in the exact syntax, it points to the right direction. 

 

this is the one.

 

COUNTROWS (
filter(SUMMARIZE (
'Sales',[Sales Person],
"Number Count", 'Sales'[Sales Row Total]), [Number Count]>1)
)

SamLester
Employee
Employee

@Anonymous, you can also use a Card visual to display this. Just drag SalesPerson into a Card visual and the count will be displayed. You can also use Count(Distinct) if you want that value.

 

Thanks,
Sam Lester (MSFT)

Anonymous
Not applicable

@ankitpatira@SamLester I already tried that before. I was using a distinct count on the Sales person (this is a sales table), it gave me the No of Sales person including the ones with only 1 sale. In the table visual, I can easily use a number of sales > 1 visual level filter. But I cannot use the same filter at the KPI (or card) visual. Please try it and you know what I mean. 

jahida
Impactful Individual
Impactful Individual

Bit late but I think a simple measure would do the trick. Something like

 

COUNTROWS(FILTER(SalesPeople, SalesPeople[Sales] > 1))

 

You could then throw that onto a card and it should give you the number you want.

 

EDIT: My bad, misunderstood the information held in the table. See below for a better answer.

ankitpatira
Community Champion
Community Champion

@Anonymous you simply need to drop Sales Person field from your table into KPI visual.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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