Forum Discussion
My calculation does not work using variable (row context issue or something else?)
- 5 years ago
How about this for the variable:
Var vNotEligibleStep1 = COUNTROWS( FILTER( Data, Data[Consent] = "Not Eligible" && Data[Step] = 1 ) )This will return 1 for each row which meets the filtered criteria. You can now keep the switch function clause.
- 5 years ago
Alternatively you can try:
new measure = SUMX(Data, [Step 1_0819])
How about this for the variable:
Var vNotEligibleStep1 =
COUNTROWS(
FILTER(
Data,
Data[Consent] = "Not Eligible" &&
Data[Step] = 1
)
)
This will return 1 for each row which meets the filtered criteria. You can now keep the switch function clause.
PaulDBrown Thank you for help. It definitely made the argument works. However, I see the total comes as 4 instead of 2. Is there way to fix this by chance?
- PaulDBrown5 years agoCommunity Champion
The problem appears to be the variable Step1.
try:
CALCULATE(
DISTINCTCOUN(Data[ClientID]),
FILTER(Data,
Data[Step] = 1 && Data[Consent] <> "Refused" && NOT(ISBLANK(Data[Consent]))))
- PaulDBrown5 years agoCommunity Champion
Alternatively you can try:
new measure = SUMX(Data, [Step 1_0819])
- JustinDoh15 years agoPost Prodigy
PaulDBrown Actually, SUMX made more output of rows, so I think it might not be the solution, but I need to review data more. Thank you so much for all your help.