Forum Discussion

JVIR's avatar
JVIR
Frequent Visitor
5 years ago
Solved

Filter in Matrix

Hi,

I'd like to have a slicer that can select all the lines when the value of the blue lines is not 0

if anyone can help

 

thanks

 

 

  • Hi, JVIR 

    According to your sample matrix visual, I’ve also created some test data to create a similar matrix as yours and use a measure to achieve your requirement, you can take a look at my steps:

    This is the original matrix I created:

     

    1. I clicked “Enter data” to create a table for the slicer:

     

    1. I created a measure like this:
    MtDiff1 =
    
    var _sum=CALCULATE([MtDiff],FILTER(ALL('Table'),[ID]=MAX([ID])))
    
    return
    
    IF(
    
        SELECTEDVALUE(Slicer[Do you want to display the data which the blue lines is 0])="No",
    
        IF(_sum=0,BLANK(),[MtDiff]),
    
    [MtDiff])
    1. Then I go to the matrix to replace the new measure with the original measure [MtDiff] and create a slicer like this:

     

    And I can achieve what you want.

    You can download my test pbix file below

     

    If this result is not what you want, you can post some sample data or your sample test pbix file(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

6 Replies

    • JVIR's avatar
      JVIR
      Frequent Visitor

      sorry

      I changed the size

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    okay when you say select all the lines do you mean only show the lines where the  value > 0?

     

    whata is the measure name being used where it is 0?  you have 2 columns showing there.

    • JVIR's avatar
      JVIR
      Frequent Visitor

      Yes all the lines <> 0

      measure name is MtDiff

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

    Hi, JVIR 

    According to your sample matrix visual, I’ve also created some test data to create a similar matrix as yours and use a measure to achieve your requirement, you can take a look at my steps:

    This is the original matrix I created:

     

    1. I clicked “Enter data” to create a table for the slicer:

     

    1. I created a measure like this:
    MtDiff1 =
    
    var _sum=CALCULATE([MtDiff],FILTER(ALL('Table'),[ID]=MAX([ID])))
    
    return
    
    IF(
    
        SELECTEDVALUE(Slicer[Do you want to display the data which the blue lines is 0])="No",
    
        IF(_sum=0,BLANK(),[MtDiff]),
    
    [MtDiff])
    1. Then I go to the matrix to replace the new measure with the original measure [MtDiff] and create a slicer like this:

     

    And I can achieve what you want.

    You can download my test pbix file below

     

    If this result is not what you want, you can post some sample data or your sample test pbix file(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

    • JVIR's avatar
      JVIR
      Frequent Visitor

      thanks for your help. It works perfectly 😊