Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
Im trying to get the count of clients per day in the last year. I got the real number using the distinct count of "Codigo_Cliente" by "Fecha_Primer_Producto".
To get the last year number, Im using the following formula:
| Count of Codigo_Cliente | Year |
| 59981 | |
| 1 | 1993 |
| 1 | 1994 |
| 1 | 1995 |
| 1 | 1996 |
| 6 | 1997 |
| 20 | 1998 |
| 282 | 1999 |
| 733 | 2000 |
| 2477 | 2001 |
| 2689 | 2002 |
| 5640 | 2003 |
| 6161 | 2004 |
| 5186 | 2005 |
| 5653 | 2006 |
| 7557 | 2007 |
| 9558 | 2008 |
| 9679 | 2009 |
| 10029 | 2010 |
| 13436 | 2011 |
| 23349 | 2012 |
| 27440 | 2013 |
| 35698 | 2014 |
| 36097 | 2015 |
| 38538 | 2016 |
| 36437 | 2017 |
| 37610 | 2018 |
| 30317 | 2019 |
Data with the date add formula:
| Year | Clientes ano pasado |
| 1998 | 2 |
| 1999 | 35 |
| 2000 | 127 |
| 2001 | 1984 |
| 2002 | 1480 |
| 2003 | 3986 |
| 2004 | 2855 |
| 2005 | 2861 |
| 2006 | 3882 |
| 2007 | 5419 |
| 2008 | 6092 |
| 2009 | 7021 |
| 2010 | 7720 |
| 2011 | 10419 |
| 2012 | 14671 |
| 2013 | 20492 |
| 2014 | 28029 |
| 2015 | 28295 |
| 2016 | 23678 |
| 2017 | 27037 |
| 2018 | 28506 |
| 2019 | 23142 |
Solved! Go to Solution.
@Anonymous you need to add calendar table in your model, there are many posts on how to do it. one you have this table, set relationship with your transaction table and then update your measure as below
Last year clients =
CALCULATE(
DISTINCTCOUNT('Clientes Hoy'[Codigo_Cliente]),
DATEADD(Calendar[Date],-1,YEAR)
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous you need to add calendar table in your model, there are many posts on how to do it. one you have this table, set relationship with your transaction table and then update your measure as below
Last year clients =
CALCULATE(
DISTINCTCOUNT('Clientes Hoy'[Codigo_Cliente]),
DATEADD(Calendar[Date],-1,YEAR)
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 51 | |
| 39 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 95 | |
| 78 | |
| 34 | |
| 28 | |
| 25 |