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
PeterRodet
New Member

Using Allexcept with filters

Hi, 

I am not an experienced DAX-user and I have a quite basic question which should not be to difficult for the experts here 🙂

 

I use powerpivot for this exercice. I have a list with all sales data, including "sales invoice nr", "invoice date", "article number", "sales amount" and "margin" for each article. I have a related Date Table too to report on year, week, etc....

 

I want to have a basic pivot table with the total sales margin for each invoice number (disregarding the number of articles on each sales invoice). I used this function: 

 

mTotalSalesMargin:=CALCULATE(SUM(SalesData[Margin]);ALLEXCEPT(SalesData; SalesData[Nr doc.]))

 

But when I create a pivot table and set a filter on the year (based on the invoice date but coming from the Date Table), it does not filter the year. I tried to change my formula and add the "invoice date" to the ALLEXCEPT-function, but it does not change anything. 

 

Someone has any idea??

Thanks a lot.Knipsel.PNG

 

 

3 REPLIES 3
PeterRodet
New Member

Thanks. But for some strange reason, the "removefilters"-function is not available in excel powerpivot?

REMOVEFILTERS is a newer function not yet available in Excel but you should be able to use ALL instead as they act the same inside of a CALCULATE.

ValtteriN
Super User
Super User

Hi,

ALLEXCEPT removes all filters except the ones you specify. This is why your year filter doesn't work. If you want to remove certain filters you might want to use e.g. REMOVEFILTERS.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors