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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MarkShu
Helper I
Helper I

How to count all clients beyond/without two last months?

I have found:

all clients - CALCULATE(COUNTA('Outflow'[ID]);ALLSELECTED('Outflow'[LastActiveDate])) 

previous month clients - CALCULATE(COUNTA('Outflow'[ID]);PREVIOUSMONTH(DATESMTD('Outflow'[LastActiveDate])))

current month clients - CALCULATE(COUNTA('Outflow'[ID]);DATESMTD('Outflow'[LastActiveDate]))

 

But I don't know how to count all clients beyond/without two last months?

1 ACCEPTED SOLUTION
MarkShu
Helper I
Helper I

Eventually I did this with DAX: Clients = CALCULATE(COUNTA('Outflow'[ID]);FILTER('Outflow;'Outflow'[Date]<DATE(YEAR(today());MONTH(today())-1;1)))

View solution in original post

5 REPLIES 5
MarkShu
Helper I
Helper I

Eventually I did this with DAX: Clients = CALCULATE(COUNTA('Outflow'[ID]);FILTER('Outflow;'Outflow'[Date]<DATE(YEAR(today());MONTH(today())-1;1)))

Thejeswar
Super User
Super User

@MarkShu,

Try the below DAX formula

 

Clients = CALCULATE(COUNTA('Outflow'[ID]);YEAR('Outflow'[LastActiveDate]) <= YEAR(TODAY()) && MONTH('Outflow'[LastActiveDate]) <= MONTH(TODAY())-2)

Oh! It works only for this year, previous year has shown until April (in matrix) =(((

@MarkShu,

Try this one....

 

Concatenate Year and Month No. and this referes to Year(Last Active Date) and Month(LastActiveDate) respectively

 

ie. YearMonth = 

2018 - Apr looks like  201804

2018 - Mar looks like 201803

2018 - Feb looks like 201802

.

.

.

.

2017 - Jan as 201701

2016 - Dec as 201612

2016 - Nov as 201611

 

Now modify the earlier DAX based on this column

 

Clients = CALCULATE(COUNTA('Outflow'[ID]);YEARMONTH <= MAX(YEARMONTH) - 2)

where YEARMONTH is the newly calculated column

 

Hope this solves this issue!!!

I did this: 

ClientsUntil2LM = CALCULATE(COUNTA('Outflow'[ID]);YEAR('Outflow'[LastActiveDate]) = YEAR(TODAY()) && MONTH('Outflow'[LastActiveDate]) <= MONTH(TODAY())-2)

 

LYsclients = CALCULATE(COUNTA('Outflow'[ID]);YEAR('Отток - всего'Outflow'[LastActiveDate])<>YEAR(TODAY()) )

 

Clients = [ClientsUntil2LM] + [LYsclients]

 

Thank you for your help! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.