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
HEW
Helper III
Helper III

Add filter to matrix so only negative values are shown

I have a matrix where the value is a measure "Running stock":

Running stock:=
CALCULATE (
    SUM (MAT_STOCK[Frit anvendelig] )+ SUM('ME80FN'[Qty])- SUM('Orders'[Qty]);
    FILTER (
        ALLSELECTED ('Date'[Date]);
        YEAR ('Date'[Date]) = YEAR (MAX('Date'[Date]))
            && 'Date'[Date] <= MAX ('Date'[Date])
    ))

 

We have quite a few articles and it is very difficult to find the ones, where the running stock is negative (red values). Matrix filter.PNG

Is it possible to add a filter, so only the articles with negative values are shown?

Thanks a lot in advance.

Br.

Helen

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

@HEW ,

 

You should modify your measure like pattern below:

Running stock =
VAR Para =
    CALCULATE (
        SUM ( MAT_STOCK[Frit anvendelig] ) + SUM ( 'ME80FN'[Qty] )
            - SUM ( 'Orders'[Qty] );
        FILTER (
            ALLSELECTED ( 'Date'[Date] );
            YEAR ( 'Date'[Date] ) = YEAR ( MAX ( 'Date'[Date] ) )
                && 'Date'[Date] <= MAX ( 'Date'[Date] )
        )
    )
RETURN
    IF ( Para < 0; Para; BLANK () )

 

Community Support Team _ Jimmy Tao

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

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

@HEW ,

 

You should modify your measure like pattern below:

Running stock =
VAR Para =
    CALCULATE (
        SUM ( MAT_STOCK[Frit anvendelig] ) + SUM ( 'ME80FN'[Qty] )
            - SUM ( 'Orders'[Qty] );
        FILTER (
            ALLSELECTED ( 'Date'[Date] );
            YEAR ( 'Date'[Date] ) = YEAR ( MAX ( 'Date'[Date] ) )
                && 'Date'[Date] <= MAX ( 'Date'[Date] )
        )
    )
RETURN
    IF ( Para < 0; Para; BLANK () )

 

Community Support Team _ Jimmy Tao

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

amitchandak
Super User
Super User

Try to have a visual level filter on the measure

@amitchandak  , I have tried but I am not able to select at measure for the filter. 

 

This is how you mean, right?

Matrix filter visual.PNG

@HEW 

Drag to visual level filter in Filter Pane

Screenshot 2020-03-25 16.30.49.png

 


Appreciate your Kudos.

@amitchandak  I have tried this as well. When I set the filter to be less than 0, the matrix is empty.

 

Just for test, I have selected less than 1 and this works - however then all the articles with 0 value shows 🙂 If I add another criteria that the value should not be 0, the matrix has no values at all....

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.