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
jaltoft
Resolver I
Resolver I

Countifs replicate Excel

=IF([This Week''s Contacts]="","",IF(COUNTIFS($G:$G,[Cust No],$T:$T,"<"&[Start Date],$T:$T,">="&EOMONTH([Start Date],-12)+1)>=1,"Y",""))

 

Column G = Cust number

Column T = Start date

 

Hello,

I want to replicate the above Excel formulae within a a DAX calculated column  within my Power BI model can anyone please help?

3 REPLIES 3
amitchandak
Super User
Super User

@jaltoft , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  essentially what I need to do is mark Y if the customer has previously been contacted in the last 12 months.

Hello @amitchandak 

 

This is an example of what the data would look like and I want to replicate the column Contact in 12 months -

 

So the forumlae in excel I need to replicate in a DAX calculated column is =IF(A2="","",IF(COUNTIFS($B$2:$B$12,B2,$C$2:$C$12,"<"&C2,$C$2:$C$12,">="&EOMONTH(C2,-12)+1)>=1,"Y",""))

 

The columns are A-D in this version

This Weeks ContactsClient NoStart DateContact 12 Months
Y123415/10/2020Y
Y123315/10/2020Y
 111112/10/2020 
Y188815/10/2020Y
Y895212/10/2020 
Y253511/10/2020 
Y123410/09/2020 
Y123308/08/2020 
Y111107/08/2020 
Y188806/06/2020 
Y925501/06/2019 

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.