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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter on measure

Hey everyone, 

 

Is there a way to count rows or distinctcount the articles where difference <0 Difference is a measure, based on several other measures. 

I only need one return with 3 as result. I do understand that I can't use a card visual, because you can't aggregate when you want to filter on a measure. But isn't there a workaround? 

 

Measure negative.jpg

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Not sure if this is what you need but:

Measure = 
CALCULATE(
    COUNTROWS( 
        FILTER(
            SUMMARIZE(
                'Articles',
                'Articles'[Aggregation_criteria],
                "Diff", [Difference]
             ),
            [Difference] < 0
        )
    )
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you guys! @goncalogeraldes , your suggestion worked perfectly, so I will be using that measure

johnt75
Super User
Super User

You can use FILTER with a measure. As it is an iterator it will perform the check for each row of the given table, e.g.

Num < 0 = COUNTROWS( FILTER('Table', [Difference] < 0) )

and you should be able to use that on a card visual as well.

goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Not sure if this is what you need but:

Measure = 
CALCULATE(
    COUNTROWS( 
        FILTER(
            SUMMARIZE(
                'Articles',
                'Articles'[Aggregation_criteria],
                "Diff", [Difference]
             ),
            [Difference] < 0
        )
    )
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

PaulDBrown
Community Champion
Community Champion

Let's assume there row filter context is from the column Table[Field] and the measure is [difference]
You can try:

Count Field =
COUNTX (
    CALCULATETABLE ( VALUES ( Table[Filed] ), FILTER ( Table, [Difference] < 0 ) ),
    Table[Field]
)

It should work in a card visual





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.