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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
HEllo everyone,
I have a simple problem I can't seem to figure out on my own.
I have a table of clients, with a column indicating the date of first purchase for a specific product line.
I have a date filter.
I want when i change the date filter, to evaluate on each line if the first purchase was in the time range selected in the filter, if so count 1 for that line, and sum the 1 to get a count of clients who made a purchase in that time range.
In SQL I would do that:
SUM(CASE WHEN date_first_purchase BETWEEN first_date AND last_date THEN 1 ELSE 0 END)
Is there a way to do that in DAX?
Thanks a lot!
I reread the documentation and achieved the desired results with a SUMX and CALCULATE with a little tweaking. Thanks anyway!
User | Count |
---|---|
10 | |
8 | |
5 | |
5 | |
4 |