Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filter by column AND (boolean) measure

I want this calculation to work, so that I can create a slicer that shows sum of purchases a customer made day 5, 14 and 30 after they received an email.

There are 2 filters that need to work
1. measurement_group: control - which works fine
2. days_orders -  doesn't work (A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.)

 

Total Conversion Control = 
CALCULATE(
COUNT('Customers'[custid]),
Onboard'[measurement_group] = "Control", 
[Days_orders] > 0)

 

Days_orders come from a linked table to solve this issue (sum the number of transactions in a given measure day):

Days_orders = switch (TRUE,
Min ( Msr1[MsrId]) = 5,
Sum ( 'Onboard'[num_trx_5days] ),
Min ( Msr1[MsrId] ) = 14,
Sum ('Onboard'[num_trx_14days] ),
Min ( Msr1[MsrId] ) = 30,
Sum ( 'Onboard'[num_trx_30days] ))
  • Anonymous's avatar
    Anonymous
    4 years ago

    I managed to solve it:

    Total Conversion =
    switch (TRUE,
    Min ( Msr1[MsrId]) = 1,
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_5days] > 0),
    Min ( Msr1[MsrId] ) = 2,
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_14days] > 0),
    Min ( Msr1[MsrId] ) =
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_30days] > 0))

3 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    Can you post sample data  or file and expected output?
    Not enough information to go on;


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I managed to solve it:

    Total Conversion =
    switch (TRUE,
    Min ( Msr1[MsrId]) = 1,
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_5days] > 0),
    Min ( Msr1[MsrId] ) = 2,
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_14days] > 0),
    Min ( Msr1[MsrId] ) =
    CALCULATE(DISTINCTCOUNT('Onboard'[custid]), 'Onboard'[num_trx_30days] > 0))