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
VO
Helper I
Helper I

Cumulative Total of Measure New Clients

Definition of new cient: A client whose first transaction is in the current year (transaction date=first transaction), subsequent transactions are excluded as new.

Trying to get the cumulative of the Measure(s): NewClients

>Month Cumulative
>Year Cumulative
>LifeTimeCumulative
>% MTD vs Prior Month MTD
>% MTD vs Prior Year Similar MTD

MTD refers to Month to Date

 

Moreover, there is a table 'Calendar' with the column 'Calendar'[Date] with a relationship to 'Fact'[TransactionDate]. Thus, the 'Calendar'[Date] will be used in reports to get the contiguous dates.

 

CustomersTransacted:=DISTINCTCOUNT([CustomerID])

 

NewClients:=

VAR NewClientsTransacted =
CALCULATE (
[CustomersTransacted],
FILTER (
'Fact',
YEAR ( Fact[FirstTransactionDate] )
= YEAR ( MAX ( Fact[TransactionDate] ) ) && Fact[FirstTransactionDate] = Fact[TransactionDate]
)
)
RETURN
NewClientsTransacted

 

Table Name: Fact

CustomerIDCustomerNameTransactionDateFirstTransactionDate
P5D01 March 202001 March 2020
P9Q02 March 202002 March 2020
P6C01 March 202001 February 2020
P8A01 February 202001 January 2020
P6C01 February 202001 February 2020
P8A01 January 202001 January 2020
P7B02 January 202002 June 2019
P4E01 December 201901 December 2019
P3F01 December 201902 June 2018
P4E01 November 201901 January 2019
P2G01 November 201901 November 2019
P1H01 October 201901 October 2019

 

NewClients.JPG

@Anonymous 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi there.

 

Please check the attached file but before you start thinking it's not doing what you wanted, please take a good look at the data the measures work with.

 

Best

D

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi there.

 

Please check the attached file but before you start thinking it's not doing what you wanted, please take a good look at the data the measures work with.

 

Best

D

@Anonymous  Thank you. It has yielded the expected outcome. Highly appreciated.

Greg_Deckler
Super User
Super User

Maybe this will help: https://community.powerbi.com/t5/Quick-Measures-Gallery/New-and-Returning-Customers/m-p/168297#M13

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Thank you for the suggestion. However, the [NewClients] measure in the original post already yielded the expected result. The link you have attached does not provide the solution. It is assistance on the related cumulative measures of the measure [NewClients] that is sought.

 

>Month Cumulative MTD
>Year Cumulative YTD
>LifeTimeCumulative
>% MTD vs Prior Month MTD
>% MTD vs Prior Year Similar MTD

MTD refers to Month to Date

So then, for example for lifetime accumulated, wouldn't you just do something like:

 

Measure = 

  VAR __Date = MAX([Date])

  VAR __Table =

    SUMMARIZE(

      'Table',

      [Date],

      "__NewClients",[NewClients]

    )

RETURN

  SUMX(FILTER(__Table,[Date]<__Date),[__NewClients])

 

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

 

@Greg_Deckler  Thank you for the suggestion. It did not give the expected result of 7, get 6 

Of greater importance would be the MTD measures

 

LifeTime := 
  VAR __Date = MAX([TransactionDate])
  VAR __Table =
    SUMMARIZE(
      'Fact',
      [TransactionDate],
      "__NewClients",[NewClients]
    )

RETURN
  SUMX(FILTER(__Table,[TransactionDate]<__Date),[__NewClients])
Anonymous
Not applicable

Hi there.

 

Your data is inconsistent.

 

CustomerID CustomerName TransactionDate FirstTransactionDate
P1 H 01-Oct-19 01-Oct-19
P2 G 01-Nov-19 01-Nov-19
P3 F 01-Dec-19 02-Jun-18
P4 E 01-Dec-19 01-Dec-19
P4 E 01-Nov-19 01-Jan-19
P5 D 01-Mar-20 01-Mar-20
P6 C 01-Mar-20 01-Feb-20
P6 C 01-Feb-20 01-Feb-20
P7 B 02-Jan-20 02-Jun-19
P8 A 01-Feb-20 01-Jan-20
P8 A 01-Jan-20 01-Jan-20
P9 Q 02-Mar-20 02-Mar-20

 

Best

D

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.