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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a measure to count customers based on some criteria. Basically I want to find the excisting customer of product A, who started to buy product B and C.
Measure =
VAR _custA =
SUMMARIZE (
FILTER (orders,orders[product]= "A"),
orders[customer ID],
"Sales", SUM (orders[sales]))
RETURN
CALCULATE(
DISTINCTCOUNT( orders[customer ID] ),
FILTER ( _custA, [customer ID] = orders[customer ID]),FILTER (orders, orders[product] = "B" || orders[product] = "C" && orders[Cohort Date] == SELECTEDVALUE('Order Date'[Yr & mt])))
I want to add a new condition in VAR _custA, which is orders[date] < DATE(2021,12,1), because the launch of product B and C was in december.
I tried this but it doesnt show any values after the modification.
Measure =
VAR _custA =
SUMMARIZE (
FILTER (orders,orders[product]= "A" && orders[date].[DATE]<DATE(2021,12,1)),
orders[customer ID],
"Sales", SUM (orders[sales]))
RETURN
CALCULATE(
DISTINCTCOUNT( orders[customer ID] ),
FILTER ( _custA, [customer ID] = orders[customer ID]),FILTER (orders, orders[product] = "B" || orders[product] = "C" && orders[Cohort Date] == SELECTEDVALUE('Order Date'[Yr & mt])))
Any idea on what the issue might be and how to fix it?
Solved! Go to Solution.
@Anonymous , try like
measure 1 = calculate(SUM (orders[sales]),FILTER (orders,orders[product]= "A" && orders[date]<DATE(2021,12,1)) )
or better use date table, you might need all to ignore selected filter
measure 1 = calculate(SUM (orders[sales]),FILTER (orders,orders[product]= "A"),FILTER (all(date), date[date]<DATE(2021,12,1))
Assuming date table is connected order date and this measure need selected date
Measure 2 = calculate(SUM (orders[sales]),FILTER (orders,orders[product] in {"B", "C"}) )
final meausre =
countx(values(orders[customer ID]), if ( not(isblank([measure 1]) ) && not(isblank([measure 2]) ) , [customer ID], blank())
same approch but for different product
Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458
@Anonymous , try like
measure 1 = calculate(SUM (orders[sales]),FILTER (orders,orders[product]= "A" && orders[date]<DATE(2021,12,1)) )
or better use date table, you might need all to ignore selected filter
measure 1 = calculate(SUM (orders[sales]),FILTER (orders,orders[product]= "A"),FILTER (all(date), date[date]<DATE(2021,12,1))
Assuming date table is connected order date and this measure need selected date
Measure 2 = calculate(SUM (orders[sales]),FILTER (orders,orders[product] in {"B", "C"}) )
final meausre =
countx(values(orders[customer ID]), if ( not(isblank([measure 1]) ) && not(isblank([measure 2]) ) , [customer ID], blank())
same approch but for different product
Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458
Perfect, thank you!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.