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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GuillaumeBD
Frequent Visitor

AllSelected inside AllExcept

Hello, I have the measure below to calculate the average price by catergory.

 

I have a filter on Address that I would like to be applied to the measure as well so that "Avg_Cat" changes if I remove/add adresses (See second print screen). I tried a bunch of stuff including adding AllSelected, but I couldn't make it work and the "Avg_cat" always stays the same. Thank you

 

Avg_Cat =
AVERAGEX ( ALLEXCEPT ( Houses, Houses[Category] ), [Price_] )

 

GuillaumeBD_1-1700837172071.png

 

Data Source

 

GuillaumeBD_2-1700837279879.png

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@GuillaumeBD,

 

Try this measure:

 

Avg_Cat = 
CALCULATE ( AVERAGE ( Houses[Price] ), ALLSELECTED ( Houses ), VALUES ( Houses[Category] ) )

 

DataInsights_0-1700966469132.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
GuillaumeBD
Frequent Visitor

Thank you!

DataInsights
Super User
Super User

@GuillaumeBD,

 

Try this measure:

 

Avg_Cat = 
CALCULATE ( AVERAGE ( Houses[Price] ), ALLSELECTED ( Houses ), VALUES ( Houses[Category] ) )

 

DataInsights_0-1700966469132.png

 





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

Proud to be a Super User!




Hello @DataInsights , I made a few changes and I can't find the new solution. Here's my new problem.

 

I have a filter "Price" and a filter "Category". What I want to do is be able to select the filter category with Avg_cat staying the same. I only want Avg_Cat to change if I modify the filter "Price" (the value resulting with the price filter should be the same with or without the category filter selected).

 

Thank you

 

 

GuillaumeBD_1-1701437595016.png

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.