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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Measure for new clients

Hi Community,

 

I need help in creating a measure that calculates number of new clients in a month. For example in the following dataset, 

new clients in July 2021 = 6 (that is these clients did not exist before July 2021)

 

ExcelPBI_0-1629689468148.png

 

Thanks in advance

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Anonymous See if this helps:

(2) New and Returning Customers - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

VahidDM
Super User
Super User

Hi @Anonymous 

Please try this measure:

New Client = 
Var _Date = SELECTEDVALUE('Table'[created on],today())
VAR _CurrentClient = CALCULATETABLE(VALUES('Table'[Client id]),filter(all('Table'),'Table'[created on]<date(year(_date),month(_Date)+1,01)))
Var _PastClient = CALCULATETABLE(values('Table'[Client id]),filter(all('Table'),'Table'[created on]<date(year(_date),month(_Date),01)))
Var _NewClient = EXCEPT(_CurrentClient,_PastClient)
return
COUNTROWS(_NewClient)

 

this measure is connected to the slicer to select the date.

VahidDM_0-1629691983477.gif

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos VahidDM_1-1629691992844.png !!

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @Anonymous 

Please try this measure:

New Client = 
Var _Date = SELECTEDVALUE('Table'[created on],today())
VAR _CurrentClient = CALCULATETABLE(VALUES('Table'[Client id]),filter(all('Table'),'Table'[created on]<date(year(_date),month(_Date)+1,01)))
Var _PastClient = CALCULATETABLE(values('Table'[Client id]),filter(all('Table'),'Table'[created on]<date(year(_date),month(_Date),01)))
Var _NewClient = EXCEPT(_CurrentClient,_PastClient)
return
COUNTROWS(_NewClient)

 

this measure is connected to the slicer to select the date.

VahidDM_0-1629691983477.gif

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos VahidDM_1-1629691992844.png !!

Greg_Deckler
Super User
Super User

@Anonymous See if this helps:

(2) New and Returning Customers - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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