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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Redex
Frequent Visitor

count number of filtered rows

 

Hello,

 

I have a table has 2 columns:

 

Col1       Col2     

A              New           

A              New      
B              Contacted      

C              Canceled            
C              Qualified

I want to summurize these data in new table as follow using dax expression not MATRIX:

Col1       New      Contacted    Canceled    Qualified

A              2             0                      0               0
B              0             1                      0               0
C              0             0                      1               1

what is the expresion will help to do this?

 

Regards,

1 ACCEPTED SOLUTION
Redex
Frequent Visitor

Here is the solution:

 

I created a new table Table 2 which contain the list of Agents name fetched from Table 1 using the following expression:

 

Table 2 = DISTINCT(Table1[AgentName])

then I created a relationship betwen Table 1 and Table 2 (Many to One *:1) and Cross filter direction (Both)

 

 

then, I started creating new columns with folowing expression:

 

ColumnName1 = CALCULATE ( COUNTROWS (Table 1), Table 1[fieldName] = "Value")

 

Now I am able to summarize the data as required.

 

 

View solution in original post

6 REPLIES 6
Redex
Frequent Visitor

Here is the solution:

 

I created a new table Table 2 which contain the list of Agents name fetched from Table 1 using the following expression:

 

Table 2 = DISTINCT(Table1[AgentName])

then I created a relationship betwen Table 1 and Table 2 (Many to One *:1) and Cross filter direction (Both)

 

 

then, I started creating new columns with folowing expression:

 

ColumnName1 = CALCULATE ( COUNTROWS (Table 1), Table 1[fieldName] = "Value")

 

Now I am able to summarize the data as required.

 

 

BhaveshPatel
Super User
Super User

You do need any expression to create this.

 

Use matrix visual to create the expected result. See the attached screenshot.matrix visualmatrix visual

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Thanks, @BhaveshPatel this helped to view the data but cannot interact with them, the reason wanted to use expression because I need to use these values in some equasions . 

Can you please post the full question including what other equations you will use these values with.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

@BhaveshPatel

 

my question is simple, regardless about the equasions because its not the issue. simply  I need the expresion which could help me to achive the requested.

I need to count the number of filtered rows. example: I have table have 50 rows, and I filtered the rows which contain value "Contacted"  . I need to get the number of the filtered rows 


filteredRows:=CALCULATE(COUNTA(Table[Col2],ALLSELECTED(Table[col2]))

 

Use col2 values as slicers. 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.