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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
mlbo
Regular Visitor

DAX to filter on rows and columns with values

I have a data set requiring a matrix visual. I want to create a slicer where if i filter on a column, for example "A" i want to see all rows where there is data in "A", but also see the corresponding columns if they contain a value. 

 

E.g. if this is my starting point:

        A     B      C

J1            10  -10

J2    20   -20   

J3    12  -12

 

When i filter on "A" in the slicer, this is how I want it to look:

        A     B     

J2    20   -20   

J3    12  -12

 

If i filter on "C" in the slicer, then it should show this:

      B      C

J1  10  -10

 

Is there a way to do this? I have tried googling but I havent been able to find anything

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mlbo ,

 

Based on your description, I created these data.

vkaiyuemsft_0-1720056927842.png

 

1. created the calculation table and used the fields in the calculation table as slicers.

Table 2 = 
DISTINCT('Table'[Column2])


2. create the MEASURE.

Measure = 
VAR _value = CALCULATE(MAX('Table'[Column3]),FILTER(ALL('Table'),'Table'[Column1] = MAX('Table'[Column1]) && 'Table'[Column2] = SELECTEDVALUE('Table 2'[Column2])))
RETURN
IF(_value = BLANK(),0,1)

 

3.Use the value of MEASURE equal to 1 as a filter for the matrix.

vkaiyuemsft_1-1720056986842.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
mlbo
Regular Visitor

Thank you, that worked!

Anonymous
Not applicable

Hi @mlbo ,

 

Based on your description, I created these data.

vkaiyuemsft_0-1720056927842.png

 

1. created the calculation table and used the fields in the calculation table as slicers.

Table 2 = 
DISTINCT('Table'[Column2])


2. create the MEASURE.

Measure = 
VAR _value = CALCULATE(MAX('Table'[Column3]),FILTER(ALL('Table'),'Table'[Column1] = MAX('Table'[Column1]) && 'Table'[Column2] = SELECTEDVALUE('Table 2'[Column2])))
RETURN
IF(_value = BLANK(),0,1)

 

3.Use the value of MEASURE equal to 1 as a filter for the matrix.

vkaiyuemsft_1-1720056986842.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.