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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rollow1234
Frequent Visitor

Help with a Matrix Visual needing to show all data based on a condition in a slicer

Goodday,

 

I have been trying to get the following to work for some hours but i have been unable to.

 

I have data that looks like

 

Rollow1234_0-1687518151428.png

 

That makes a matrix visual that looks like

 

Rollow1234_1-1687518170853.png

 

Now i want to be able to select a month in a slicer, and then if that month has a  1 in the values, that it displays all months for that row.

 

A bit like when i select "Feb", that it displays

Rollow1234_2-1687518261042.png

 

And when i select jan that it displays

Rollow1234_3-1687518276639.png

 

 

Does anyone know how i would achieve this?

 

 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi  @Rollow1234 

You can refer to the following example

1.You need to create a new table to as a filter

vxinruzhumsft_0-1687746648664.png

 

2.Then create two meausre

Measure = var a=FILTER(ALLSELECTED('Table'),[Month] in VALUES('Table 2'[Month])&&[Showup]=1)
return COUNTROWS(FILTER(a,[A] in VALUES('Table'[A])&&[B] in VALUES('Table'[B])))
Measure 2 = IF(ISFILTERED('Table 2'[Month]),IF([Measure]>0,CALCULATE(SUM('Table'[Showup]))),SUM('Table'[Showup]))

3.Then put the measure 2 to the visual matrix and put the month field of table2 to the slicer

Output

vxinruzhumsft_1-1687746804590.png

 

vxinruzhumsft_2-1687746813316.png

 

Best Regards!

Yolo Zhu

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

4 REPLIES 4
v-xinruzhu-msft
Community Support
Community Support

Hi  @Rollow1234 

You can refer to the following example

1.You need to create a new table to as a filter

vxinruzhumsft_0-1687746648664.png

 

2.Then create two meausre

Measure = var a=FILTER(ALLSELECTED('Table'),[Month] in VALUES('Table 2'[Month])&&[Showup]=1)
return COUNTROWS(FILTER(a,[A] in VALUES('Table'[A])&&[B] in VALUES('Table'[B])))
Measure 2 = IF(ISFILTERED('Table 2'[Month]),IF([Measure]>0,CALCULATE(SUM('Table'[Showup]))),SUM('Table'[Showup]))

3.Then put the measure 2 to the visual matrix and put the month field of table2 to the slicer

Output

vxinruzhumsft_1-1687746804590.png

 

vxinruzhumsft_2-1687746813316.png

 

Best Regards!

Yolo Zhu

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

 

Goodday! Thank you for the help, interesting measures for sure. Sadly enough i think i do something wrong because it doesnt seem to work. Empty values display as empty instead of 0, and because of that the slicer still doesnt work. 

 

Rollow1234_0-1687762746961.png

Rollow1234_1-1687762761806.pngRollow1234_2-1687762774464.png

 

Rollow1234_3-1687762784743.png

 

Any idea why?

 

 

 

Hi @Rollow1234 

You need to put the "Month" column of sheet 1 to column of the matrix instead of putting the "Month" column of Month table to it.

vxinruzhumsft_0-1687766680749.png

Best Regards!

Yolo Zhu

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

 

It works like a charm! Thank you very very much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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