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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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