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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

FILTER and COUNTROWS, need help to understand formula

Hi,

 

I have a formula that seems to work (assigns negative deltas to negatives, positive deltas to positives), but I can't really understand it, thus not sure if it's possible to improve it. 

 

My_Measure =
CALCULATE (
    [Delta],
    FILTER (
        VALUES ( Products[Items] ),
        COUNTROWS (
            FILTER ( Ranges, [Delta] >= Ranges[Negative] && [Delta] < Ranges[Positive] )
        ) > 0
    )
)

Ranges is a simple table like this:

 

RangeNegativePositive
Negative-9999999990.00001
Positive-0.00001999999999

 

Not sure if this table is necessary, however this not my setup, so I don't want to break it, if I'm not sure 100%. 

1 REPLY 1
lbendlin
Super User
Super User

Use DAX Studio (install it if you don't have it) and check the performance of that measure in various scenarios of your dataset.  That will show you if you have to optimize it or not.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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