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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.