The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
So I have a table as follows:
Customers | Days Since Purchased | Other Columns |
Anya | 123 | - |
Bob | 223 | - |
Caroline | 6000 | - |
Dally | 5732 | - |
Anya | 4511 |
I want to find the COUNT of CUSTOMERS who have purchased within the ast 2000 days (and in this table see, for example Anya has purchased reently as wel as several days earlier, we would like to keep only Anya's recent purchase and hence the COUNT should return 2 (since Dally and Caroline have purchased > 2000 days before).
Sample Data: Download Excel File
Thanks!
Solved! Go to Solution.
@Anonymous , Try a measure like
countx(filter(summarize(Table, Table[Customers], "_1", min(Table[Days Since Purchased])),[_1]>2000),[Customers])
Please stop using SUMMARIZE for anything else but grouping and do not recommend it to others, especially those that are not very familiar with the quirks of DAX. This function is "broken" and there are much better alternatives. If you want to know why, please read this: https://www.sqlbi.com/articles/all-the-secrets-of-summarize/
Thanks.
@Anonymous , Try a measure like
countx(filter(summarize(Table, Table[Customers], "_1", min(Table[Days Since Purchased])),[_1]>2000),[Customers])
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
101 | |
81 | |
62 | |
54 |
User | Count |
---|---|
249 | |
119 | |
115 | |
94 | |
70 |