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

DAX - How do i get rows count from the result set ??

Hello,

 

I have 3 tables which are all linked to each other.

 

Now i am doing group by which includes all the 3 table columns and it returned some records.

 

Now i want the result set records count. How do i get that. Please help me..

7 REPLIES 7
SivaMani
Resident Rockstar
Resident Rockstar

Please do refer the below DAX function,

https://msdn.microsoft.com/en-us/query-bi/dax/count-function-dax

 

 

Anonymous
Not applicable

@SivaMani i need overall records count. Like we have in SQL

 

Select Count(*) from TableA Group by ColumnA

Hi @Anonymous,

 

How did you group the tables? Please try the function "COUNTX". Reference: query-bi/dax/countx-function-dax. It could be like below.

Measure = Countx([Groupby table], [to count column name])

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-jiascu-msft,

 

I have three tables with those tables i am doing the group by.

 

If i am using the CountX function i need to specify only one table then the result will be wrong.

Hi @Anonymous,

 

How did you do "Groupby" for now? The first parameter of COUNTX is a table expression, which means we can put a expression that returns a Table. Can you share a sample?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-jiascu-msft,

 

Please check the below query, 

 

EVALUATE
SUMMARIZECOLUMNS(
Table1[ColumnA],

Table1[ColumnB],

Table2[Column2],

Table3[Column4],
FILTER(VALUES(Table1[ColumnA]),Table1[ColumnA]="ABC"),
"Total",SUM(Table1[CreditAmount])
)

Anonymous
Not applicable

EVALUATE

ROW("count",

COUNTROWS(
SUMMARIZECOLUMNS(
Table1[ColumnA],

Table1[ColumnB],

Table2[Column2],

Table3[Column4],
FILTER(VALUES(Table1[ColumnA]),Table1[ColumnA]="ABC"),
"Total",SUM(Table1[CreditAmount])
)))

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.