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
sfooshee
Regular Visitor

(Calculated column) Count any row if column value = row value

So I've got a COUNTIFS excel formula (calculated) that counts any row that meets multiple criteria, including matching a value on the current row. But it is a calculated column so I can't just use " " to find a value, it needs to match whatever is on the row.

 

My excel formula looks like this:

 

COUNTIFS(AM:AM,"Completed",D:D,[@[Visit Date]],N:N,[@First Name],AO:AO)>0

 

So I need a DAX formula that does that. It can search a column for a value that matches the current row. Any thoughts?

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @sfooshee 

 

It's better to provide some sample data (in a format people can copy) with expected result. I don't understand your COUNTIFS without enough context, but basically you can do DAX calculated column like below, if you have multiple conditions, use &&

Column = COUNTROWS(FILTER('Table','Table'[yourColumn]=EARLIER('Table'[yourColumn])))

OR

Column = 
VAR CurValue = 'Table'[yourColumn]
RETURN
COUNTROWS(FILTER('Table','Table'[yourColumn]= CurValue))

 

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @sfooshee ,

 

Have you sovled your issue? If not, would you please show us some sample data and your expected result. Then we can help you more accurately.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Vera_33
Resident Rockstar
Resident Rockstar

Hi @sfooshee 

 

It's better to provide some sample data (in a format people can copy) with expected result. I don't understand your COUNTIFS without enough context, but basically you can do DAX calculated column like below, if you have multiple conditions, use &&

Column = COUNTROWS(FILTER('Table','Table'[yourColumn]=EARLIER('Table'[yourColumn])))

OR

Column = 
VAR CurValue = 'Table'[yourColumn]
RETURN
COUNTROWS(FILTER('Table','Table'[yourColumn]= CurValue))

 

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.