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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
calen
Helper I
Helper I

How to Stop Filtering a Measure

Hello All, 

 

I am trying to create a column which compares all values to Net Sales. Our company calculates Net Sales as Gross Sales - Returns and Discounts. The picture below is what I'm trying to achieve: Net Sales are 150 and I'm trying to compare every other total to that value. 

calen_1-1592848521497.png

 

I'm sure there is a simple way to do this but every way I have tired does not give me the results I want. I have created two measures, the first one calculates Net Sales:

calen_2-1592848745011.png

The next calculates the posted amount over the Net Sales measure:

calen_3-1592848815675.png

 

I have also tried a different version of the above formulas: 

calen_4-1592848879184.png

 

 

Below are the results I'm getting based off of the formulas above. As you can see it's not dividing by the total Net Sales and in the case of the lower rows, it's dividing by 0 because they aren't in the net sales calculation. 

calen_5-1592849051631.png

 

Any insight would be greatly appericated. 

 

Thanks,

Calen

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

Hi @calen ,

 

You could use ALLSELECTED( 'Your table' ). Here is a measure for your reference.

Measure =
VAR a =
    CALCULATE (
        SUM ( 'Table'[Posted Amount] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Row No.] IN { 4010, 4020, 4030, 4035, 4040 }
        )
    )
VAR b =
    ABS ( SELECTEDVALUE ( 'Table'[Posted Amount] ) ) / a
RETURN
    b

Here is the result:

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @calen ,

 

You could use ALLSELECTED( 'Your table' ). Here is a measure for your reference.

Measure =
VAR a =
    CALCULATE (
        SUM ( 'Table'[Posted Amount] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Row No.] IN { 4010, 4020, 4030, 4035, 4040 }
        )
    )
VAR b =
    ABS ( SELECTEDVALUE ( 'Table'[Posted Amount] ) ) / a
RETURN
    b

Here is the result:

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank you for your help!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Top Kudoed Authors