Forum Discussion
fazza1991
4 years agoHelper II
DAX Measure Not Summing
Hi,
I have tried everything to get this measure to give me an accurate total sum.
LostCustomers(2)
VAR CustomersPurcahsed = CALCULATETABLE(VALUES(P[ACCOUNT_ID]),
FILTER(ALL('Date'),
'Date'[Date] > MIN ('Date'[Date]) - 90 &&
'Date'[Date] < MIN ('Date'[Date]) - 30 ))
VAR PriorCustomers = CALCULATETABLE(VALUES(P[ACCOUNT_ID]),
FILTER(ALL('Date'),
'Date'[Date] > MIN ('Date'[Date]) - 60 &&
'Date'[Date] < MIN ('Date'[Date])))
RETURN
COUNTROWS(EXCEPT(CustomersPurcahsed,PriorCustomers))
Used HASONEFILTER combined with SUMX, COUNTX but all results give me some aggregates which is not what i am expecting.
ALternatively a column formula for lost customers between in a period is more than suitable
4 Replies
- smpa01Community Champion
fazza1991 does this help?
LostCustomers(2) VAR CustomersPurcahsed = CALCULATETABLE(VALUES(P[ACCOUNT_ID]), FILTER(ALL('Date'), 'Date'[Date] > MIN ('Date'[Date]) - 90 && 'Date'[Date] < MIN ('Date'[Date]) - 30 )) VAR PriorCustomers = CALCULATETABLE(VALUES(P[ACCOUNT_ID]), FILTER(ALL('Date'), 'Date'[Date] > MIN ('Date'[Date]) - 60 && 'Date'[Date] < MIN ('Date'[Date]))) RETURN COUNTX((EXCEPT(CustomersPurcahsed,PriorCustomers)),P[ACCOUNT_ID])- fazza1991Helper II
Hey,
Afraid not. Only gives me the total of the first month
- AlexisOlsonSuper User
Your measure looks reasonable. Can you post some sample data along with what you're getting versus what you expect to get?
- AnonymousNot applicable
Hi fazza1991,
Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng