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.
Hi
I would like to count the total number of customers, so I can show that i 2019 we had 6 customers and in 2020 we had 7 customers and so on. Which function is the right one to choose for that?
I dosnt work for me to use DISTINCTCOUNT or TOTALYTD
My data looks like this.
CustNumber | CompanyName | CreatedDate |
98 | Very Old Company | 01-01-1983 |
99 | Older Company | 01-01-1993 |
100 | Old Company | 01-01-2003 |
101 | Walmart Inc. (WMT) | 01-08-2019 |
102 | China Petroleum & Chemical Corp. (SNP) | 01-09-2019 |
103 | Amazon.com Inc. (AMZN) | 01-10-2019 |
104 | PetroChina Co. Ltd. (PTR) | 01-04-2020 |
105 | Apple Inc. (AAPL) | 01-02-2021 |
106 | CVS Health Corp. (CVS) | 02-02-2021 |
107 | Royal Dutch Shell PLC (RDS. A) | 01-05-2022 |
108 | Berkshire Hathaway Inc. (BRK. A) | 01-06-2022 |
109 | Toyota Motor Corp. (TM) | 01-07-2022 |
110 | Volkswagen AG (VWAGY) | 01-08-2022 |
What I would like to show is:
Year | Total Number of Customers Created | Net increase compared to last year |
2019 | 6 | |
2020 | 7 | 1 |
2021 | 9 | 2 |
2022 | 13 | 4 |
Thank you
Solved! Go to Solution.
Hi @LangeJan ,
Create the following two measures:
Cumulative customers = CALCULATE(DISTINCTCOUNT('Table'[CustNumber]), 'Table'[year]<= MAX('Table'[year]))
var cumulative =
[Cumulative customers]
- CALCULATE ( [Cumulative customers], 'Table'[year] = MAX ( 'Table'[year] ) - 1 )
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @LangeJan ,
Create the following two measures:
Cumulative customers = CALCULATE(DISTINCTCOUNT('Table'[CustNumber]), 'Table'[year]<= MAX('Table'[year]))
var cumulative =
[Cumulative customers]
- CALCULATE ( [Cumulative customers], 'Table'[year] = MAX ( 'Table'[year] ) - 1 )
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |