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

What is the Substitute for COUNTIFS date based formula in Power BI ?

So I have this formula in excel in my raw data (not separate totals field)

=COUNTIFS([Date range],">="&(EOMONTH(Date,-1)+1),[Date range],"<="&EOMONTH(Date,0))

Power BI however doesn't have this function. I tried to use Calculate, but it is still confusing for me to understand some of these formulas.
Can you please show me the substitute for this formula in Power BI ?

3 REPLIES 3
JosefPrakljacic
Solution Sage
Solution Sage

Hey @Anonymous ,

 

this would be the solution for your formula. 

RowCount :=
COUNTROWS ( FILTER ( TableWithDateColumn, DateColumn >= X && Datecolum <= X ) )

If this post was helpful may I ask you to mark it as solution and give it some kudos?

Have a nice day!

BR,
Josef

Anonymous
Not applicable

Hey, @JosefPrakljacic 

So what is X in your case ?

Because in my case I use EOMONTH formula, and I doesn't seem you found a solution to it.

I will try to do something with what you provided, but cannot mark it as solution, because it doesn't answer my question.

RowCount :=
COUNTROWS ( FILTER ( TableWithDateColumn, DateColumn >= EOMONTH(DateColumn,The number of months before or after the start_date) && Datecolum <= EOMONTH(DateColumn, The number of months before or after the start_date) ) )

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.

Top Solution Authors