Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All,
I need help on writing DAX for calculating the count of customers whose status flag is changing from 0 to 1 in a particular month.
where 0 indicates new user (first order)and 1 indicates repeat user (2nd order).
Please help on writing DAX query for
1. No . of users whose status flag changing from 0 to 1
2. And only count of users with status indicator 1 (exclude users with status flag changes from 0 to 1) in a particular month
Thanks & Regards,
Rajeev Bikkani
Solved! Go to Solution.
Hi @Anonymous,
Please create measures like below:
Count repeat =
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Cust_Ord_Rept_in] ),
ALLSELECTED ( Cust_Order[Cust_Ord_Rept_in] )
)
count custom 1=
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Ord_Cust_Id] ),
FILTER ( ALLEXCEPT ( Cust_Order, Cust_Order[Month] ), [Count repeat] = 2 )
)
count custom 2 =
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Ord_Cust_Id] ),
FILTER (
ALLEXCEPT ( Cust_Order, Cust_Order[Month] ),
[Count repeat] = 1
&& Cust_Order[Cust_Ord_Rept_in] = 1
)
)
Best regards,
Yuliana Gu
Hi @Anonymous,
Please create measures like below:
Count repeat =
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Cust_Ord_Rept_in] ),
ALLSELECTED ( Cust_Order[Cust_Ord_Rept_in] )
)
count custom 1=
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Ord_Cust_Id] ),
FILTER ( ALLEXCEPT ( Cust_Order, Cust_Order[Month] ), [Count repeat] = 2 )
)
count custom 2 =
CALCULATE (
DISTINCTCOUNT ( Cust_Order[Ord_Cust_Id] ),
FILTER (
ALLEXCEPT ( Cust_Order, Cust_Order[Month] ),
[Count repeat] = 1
&& Cust_Order[Cust_Ord_Rept_in] = 1
)
)
Best regards,
Yuliana Gu
Hi Yuliana,
Thankyou for providing the solution.
Thanks & Regards,
Rajeev Bikkani
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.