half of a glazier
half of a glazier

Reputation: 2076

How to get table rowcount in DAX Studio

I'm trying to compare the column count of two tables, one in SSMS and one in DAX Studio, but I've never worked with DAX or Dax Studio before.

In SSMS, I ran SELECT COUNT(*) FROM MyTable to see the rowcount.

In DAX Studio, I ran COUNTROWS(MyTable) but it produced this error:

The syntax for '<pii>COUNTROWS</pii>' is incorrect.

I know there's probably something I need to add to make a valid query but can't find it. How can I query the row number of a table?

Upvotes: 3

Views: 5836

Answers (1)

Simon Noer Petersen
Simon Noer Petersen

Reputation: 129

Youre using dax studio. it can only return table expressions So you need to create a table in your dax expression.

like this :

EVALUATE
ROW("RowCount", COUNTROWS(MyTable))

Upvotes: 4

Related Questions