Forum Discussion

GCL's avatar
GCL
Frequent Visitor
3 years ago
Solved

Filter data in a matrix with column dependencies

Dear,
Hello,

 

I'm trying to find a solution for the following scenario.

 

A slicer contains four (char) values: A B C D. Each value represents a step in a process flow.
Principles to be applied:
- case (A) I would like to see the values A B as columns in a matrix in case of selecting the slicer value B
- case (B) I would like to see the values A B C as columns in a matrix in case of selecting the slicer value C
- case (C) I would like to see the values A B C D as columns in a matrix in case of selecting the slicer value D

 

On top of this, I'm only interested in these matrix rows where
case (A) process step A -> A-flag = 1
case (B) process step A and B -> A-flag = 1 and B-flag = 1
case (C) process step A and B and C -> A-flag = 1 and B-flag = 1 and C-flag = 1


Thank you for considering my scenario!

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi GCL 

     

    Please new a measure:

    Measure = 
    VAR _slicer = SELECTEDVALUE('Table2'[Step])
    VAR _step = MAX('Table'[Step])
    VAR _filter = 
    SWITCH(
        TRUE(),
        _slicer="A"&&_step="A"&&[Flag-A]=1),1,
        _slicer="B"&&(_step="A"||_step="B")&&([Flag-A]=1&&[Flag-B]=1),1,
        _slicer="C"&&(_step="A"||_step="B"||_step="C")&&([Flag-A]=1&&[Flag-B]=1&&[Flag-C]=1),1,
        _slicer="D",1
    )
    RETURN
    _filter

    then use as matrix's filter.

    If this doesn't work or I misunderstood your requirements, please consider releasing the file with the sensitive data removed and the expected output.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GCL 

     

    Please new a measure:

    Measure = 
    VAR _slicer = SELECTEDVALUE('Table2'[Step])
    VAR _step = MAX('Table'[Step])
    VAR _filter = 
    SWITCH(
        TRUE(),
        _slicer="A"&&_step="A"&&[Flag-A]=1),1,
        _slicer="B"&&(_step="A"||_step="B")&&([Flag-A]=1&&[Flag-B]=1),1,
        _slicer="C"&&(_step="A"||_step="B"||_step="C")&&([Flag-A]=1&&[Flag-B]=1&&[Flag-C]=1),1,
        _slicer="D",1
    )
    RETURN
    _filter

    then use as matrix's filter.

    If this doesn't work or I misunderstood your requirements, please consider releasing the file with the sensitive data removed and the expected output.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data