CountIf in DAX

lager1001

Board Regular
Joined
May 17, 2019
Messages
88
I have two tables. I need to count the number of rows in Table 1 where Column 2 does not contain zero, and where column 1's values match the value in Table 2, Column 1. Can't get my mind around it. Been trying all sorts of combinations. Below are examples of the two tables. Table has the new calculated column I am seeking. I have connected a relationship between Table1 and Table 2 based on Column 1 in both tables.
TABLE 1
Column1
Column 2
ABCD​
0​
EFGH​
1​
ABCD​
1​
ABCD​
1​
ABCD​
0​
EFGH​
0​
EFGH​
0​

TABLE 2 WITH NEW CALCULATED COLUMN

COLUMN1
NEW COLUMN
ABCD​
2​
EFGH​
1​
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I'm not wanting to do this in M (Power Query) but rather in PowerPivot (DAX). I have been able to formulate my CountIFs for other columns but I have not been able to find the proper DAX syntax for my original post. Still searching.
 
Upvote 0

Forum statistics

Threads
1,223,798
Messages
6,174,667
Members
452,576
Latest member
AlexG_UK

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top