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

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

Reply
Waseem
Helper III
Helper III

Function that does not ignore filters

Dear All

 

I am using following formula to calculate a measure value:

 

Net Amount = SUM([Amount])-CALCULATE(SUM([Amount]),FILTER(ALL('Subs'),[DESCRIPTION]="Rental"))

 

However, when i apply filters in the graphs, all numbers get ruined. Is there an alternative to "ALL" that does not ignore filters but gives same results?

 

Regards 

6 REPLIES 6
Phil_Seamark
Microsoft Employee
Microsoft Employee

HI @Waseem

 

Please try this tweak as a quick test

 

Net Amount = SUM([Amount])-CALCULATE(SUM([Amount]),FILTER(ALLSELECTED('Subs'),[DESCRIPTION]="Rental"))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil

 

I already tried "ALLSELECTED" as well but same impact.

 

Appreciate though.

 

Regards 

Anonymous
Not applicable

Allselected not working could be due to your data model. If you can share more info that may help.

 

Also try removing the argument from the allselected as follows 

 

Net Amount =
SUM ( [Amount] )
    - CALCULATE (
        SUM ( [Amount] ),
        FILTER ( ALLSELECTED (), [DESCRIPTION] = "Rental" )
    )

Hi Thomas

 

I have following model linked from excel:

 

I am trying to sumup the BILLAMOUNT column by filtering out three items (highlighted in yellow) from column "DESCRIPTION". The results are fine when I do not apply any filters. However, when I apply filters on the "Equip ID" column, which is linked to another amapping file, I get messed up numbers. Appreciate your help.

 

Capture.JPG

Hi @Waseem

"when I apply filters on the "Equip ID" column, which is linked to another amapping file, I get  messed up numbers. "

what is the another amapping file, is it a table which having a relationship with this table?

What is the relationship between this table and "another amapping file"?

 

Best Regards

Maggie

Hi @v-juanli-msft

 

The structure of data is such that

1-I have a two tables for revenues, one of which contains product and channel ID information against each record while other has monthly accumulated numbers without product and channel code.

2-I allocated second table revenue (the aggregated one) by pulling it in first revenue file (that contains channel and product codes) by allocating revenues against each line item.

3-I then summed up two revenue columns to get total revenue.

 

Now when I prepare a chart of total revenue with date on X-axis, i get perfect result. However when I prepare same graph with products or channels on x-axis, I get some products/channel information in negative. There is no negative value in my revenue columns.

 

Thanks a lot for your concerns and would appreciate if you could help me to resolve it.

 

Cheers

 

Helpful resources

Announcements
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 Kudoed Authors
Users online (5,874)