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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Cyriackpazhe
Helper III
Helper III

Allexcept

Screenshot (15).pngCan someone explain how the allexcept used as table expression in summarize work here. Is there any alternative to produce the required meaure

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@Cyriackpazhe 

The ALLEXCEPT function in DAX is used to remove all filters from a table except for the specified columns. In the provided code, ALLEXCEPT is used within the SUMMARIZE function to create a summary table that includes all rows from the Winesales table, but only keeps the filter on the WINE column. This allows the calculation of the average yearly sales for each wine across all years.

 

Yearly Average Each Wine =
VAR Summarytable =
SUMMARIZE (ALLEXCEPT (Winesales, Wines [WINE]), DateTable [YEAR] )
RETURN
AVERAGEX (Summarytable, [Total Sales])




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Monika_Hr
New Member

If you have a Product table with five columns (ProductKey, ProductName, Brand, Flavor, Category), the following syntaxes produce the same result:

ALL ( Product[ProductName], Product[Brand], Product[Flavor] )

ALLEXCEPT ( Product, Product[ProductKey], Product[Category] )

My understanding base on your picture is, that our goal is to get result for average amount of wines sold and the average should be counted per year. I tried to use that approach with my data, where I use chocolate products instead of wines. I created one measure according your photo and another measure using ALL instead of the ALLEXCEPT. Then I controlled the results base on orders in Sales table.Screenshot 2025-02-11 010204.jpg 

View solution in original post

3 REPLIES 3
Monika_Hr
New Member

If you have a Product table with five columns (ProductKey, ProductName, Brand, Flavor, Category), the following syntaxes produce the same result:

ALL ( Product[ProductName], Product[Brand], Product[Flavor] )

ALLEXCEPT ( Product, Product[ProductKey], Product[Category] )

My understanding base on your picture is, that our goal is to get result for average amount of wines sold and the average should be counted per year. I tried to use that approach with my data, where I use chocolate products instead of wines. I created one measure according your photo and another measure using ALL instead of the ALLEXCEPT. Then I controlled the results base on orders in Sales table.Screenshot 2025-02-11 010204.jpg 

bhanu_gautam
Super User
Super User

@Cyriackpazhe 

The ALLEXCEPT function in DAX is used to remove all filters from a table except for the specified columns. In the provided code, ALLEXCEPT is used within the SUMMARIZE function to create a summary table that includes all rows from the Winesales table, but only keeps the filter on the WINE column. This allows the calculation of the average yearly sales for each wine across all years.

 

Yearly Average Each Wine =
VAR Summarytable =
SUMMARIZE (ALLEXCEPT (Winesales, Wines [WINE]), DateTable [YEAR] )
RETURN
AVERAGEX (Summarytable, [Total Sales])




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Is there any alterantive. Like using Values

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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