Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
GCL
Frequent Visitor

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!

 

1 ACCEPTED SOLUTION
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.

vcgaomsft_0-1664964318767.png

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

View solution in original post

1 REPLY 1
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.

vcgaomsft_0-1664964318767.png

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.