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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Heidilein
Helper I
Helper I

FILTER on Measure column

Hello everyone,

 

I am trying to find a solution for following use case:

I have a table where the difference between two values with time-intelligence is calculated by a measure:

First measure 

PrevMonthValue= CALCULATE(SUM(Table[Price]), DATEADD(Table[Date],-1, MONTH))
 
Second measure
DeltaPrice = [Price]-[PrevMonthValue]
 
Now I would like to filter only those values of my second measure which are <> 0.
 
I have tried it by using FILTER expression or also with a check upon a boolean value but it does not work.
 
Follwing thing I hava tried:
Changed =
VAR vChangedTable =
    ADDCOLUMNS (
        Table,
        "@Delta", [DeltaPrice]
    )
VAR vFilteredTable =
    FILTER (
        vChangedTable,
        [@Delta] <> 0
    )
RETURN
    CALCULATE (
        SUM(Table[Price]) ,
        vFilteredTable
    )
But it does not work.
Is there any other elegant way to filter upon a measure?
 
Thanks in advance for your support.
 
1 ACCEPTED SOLUTION

@tamerj1 

Found a possible solution by changing your measure into this:

 

Changed =
COUNTROWS (
    FILTER (
        ALL ( 'Table'[Price] ), [DeltaPrice] <> 0
    )
)
 
It works by returning 1 and afterwards when set in the visual as a filter. 
Thanks for your support!

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @Heidilein 
What do you have in the table visual? Can place a screenshot?

Hi @tamerj1 

this is the visual:

Heidilein_0-1683545771200.png

 

@Heidilein 
Place the following measure in the filter pane of the matrix, select is not balnk and apply the filter.

Changed =
COUNTROWS (
    FILTER (
        VALUES ( 'Table'[Article] ),
        CALCULATE ( [DeltaPrice], ALL ( [Date] ) ) <> 0
    )
)

Hi @tamerj1 

 

thanks, but does not work, because the value of "Changed" is always 1. 

Heidilein_0-1683546938178.png

 

I have also tried this with an if statement by checking the difference between the two values, but the filter did not work. Any other idea?

@Heidilein 
Would you please paste a screenshot of your measure code?

@tamerj1 

Changed =
COUNTROWS (
    FILTER (
        VALUES ( 'Table'[Article] ),
         CALCULATE ( [Delta], ALL ( Table[Date] ) ) <> 0
    )
)
 

@tamerj1 

Found a possible solution by changing your measure into this:

 

Changed =
COUNTROWS (
    FILTER (
        ALL ( 'Table'[Price] ), [DeltaPrice] <> 0
    )
)
 
It works by returning 1 and afterwards when set in the visual as a filter. 
Thanks for your support!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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