Forum Discussion

EAB1977's avatar
EAB1977
Frequent Visitor
4 years ago
Solved

Measure as a Filter assistance

All,

 

I have a page on my Power BI report that is looking at data within an Excel file. I have a table set up that has the following:

 

  • Date
  • Plant ID
  • Machine ID
  • Product
  • Input Cup Counts
  • Output Cup Counts
  • Lost Prod
  • Yield %

 

The Input/Output/Lost Prod columns are all summarized and the Yield % is an average.

 

I need to exclude records from this table (Output Count = 0 or Lost Prod < -1000) which will be used within the Filters On All Pages section of the Filters Pane so I figured I'd create a Measure Table and do a simple measure within said table.

 

SumOfLostProduction = Sum(Data[Lost Prod])
IsException = OR(MeasureTable[SumOfLostProduction] < -1000, Sum(Data[Output Cup Counts]) = 0)
 
Trying to place this within a filter does not seem to work. What can I do to use this as a filter to Exclude records from my report? I am a bit rusty at this so some documentation or explination would help.
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi EAB1977 ,

     

    I agree with amitchandak's reply.  As far as I know, Power BI only supports us to add measure as a filter in visual level filter. So we couldn't add measures as filter in Page/Report level filter. Page/Report level filter could only add columns.

    So I suggest you to add [IsException] measure as a filter into visual level filter in the visuals you want to filter by it.

    I think filter could not identify  True() or False(). Try to use 1 to replace True() and 0 to replace False().

    IsException =
    IF (
        OR (
            MeasureTable[SumOfLostProduction] < -1000,
            SUM ( Data[Output Cup Counts] ) = 0
        ),
        1,
        0
    )

    Let [IsException] measure to show items when the value =1 in visual level filter.

     

     

    Best Regards,
    Rico Zhou

     

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

3 Replies

  • EAB1977 , Measure filter can only be used at the visual level filter. So you need apply that to each visual

    • EAB1977's avatar
      EAB1977
      Frequent Visitor

      When I bring it into each visual via the Filter, I expect to see True or False as selections. I don't see anything.

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi EAB1977 ,

     

    I agree with amitchandak's reply.  As far as I know, Power BI only supports us to add measure as a filter in visual level filter. So we couldn't add measures as filter in Page/Report level filter. Page/Report level filter could only add columns.

    So I suggest you to add [IsException] measure as a filter into visual level filter in the visuals you want to filter by it.

    I think filter could not identify  True() or False(). Try to use 1 to replace True() and 0 to replace False().

    IsException =
    IF (
        OR (
            MeasureTable[SumOfLostProduction] < -1000,
            SUM ( Data[Output Cup Counts] ) = 0
        ),
        1,
        0
    )

    Let [IsException] measure to show items when the value =1 in visual level filter.

     

     

    Best Regards,
    Rico Zhou

     

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