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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
AnetaK
Helper V
Helper V

ALL not working

Hi,

 

I am working on one table on sales with columns:

- table[Customer]

- table[Product]

- table[Order_date]

- table[Sale]

and measure:

- Sales=SUM(table[sale])

 

I want to create an average sale value for all customers and then find whether a specific customer spends more or less $ than average.

I've created a formula:

AvgSales = CALCULATE ( DIVIDE [Sales], DISTINCTCOUNT ( table[Customer] ), ALL ( table[Customer] ))

It works when I show it as value in the Card. It works, when I show it in a table with:

-Product

-Sales

-Avg sales

-Deviation from avg ( [Sales] - [AvgSales] )

 

But when I choose a specific customer on the slicer, Avg sales equals company Sales and not the total Sales for the product.

What do I do wrong?

 

 

Przechwytywanie.PNG

 

 

 

 

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi AnetaK,

 

I have made a sample data based on your description like below:

1.PNG

If works well when no customer has been selected in slicer:

2.PNG

To achieve the total value of products when a customer has been selected, you can modify measure [Avg sales] like this:

 

AvgSales = CALCULATE ( DIVIDE([Sales], DISTINCTCOUNT ( 'Table'[Customer] )), ALLEXCEPT('Table', 'Table'[Customer]))

 

3.PNG

PBIX here: https://www.dropbox.com/s/0plppnuj6qcaikc/For%20AnetaK.pbix?dl=0

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi AnetaK,

 

I have made a sample data based on your description like below:

1.PNG

If works well when no customer has been selected in slicer:

2.PNG

To achieve the total value of products when a customer has been selected, you can modify measure [Avg sales] like this:

 

AvgSales = CALCULATE ( DIVIDE([Sales], DISTINCTCOUNT ( 'Table'[Customer] )), ALLEXCEPT('Table', 'Table'[Customer]))

 

3.PNG

PBIX here: https://www.dropbox.com/s/0plppnuj6qcaikc/For%20AnetaK.pbix?dl=0

 

Regards,

Jimmy Tao

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.