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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.