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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
lilyyan
Frequent Visitor

What's the difference between ALL vs. ALLSELECTED, with formula filter as table vs. column

The original file Understanding Your Customers is downloaded from http://enterprisedna.co/power-bi-resources.

 

When calculating the total sales with different filters ALL and ALLSELECTED, with formula filter as table vs. column, the different results totally confused me. 

 

Here's the different results:

1. For Cumulative Caculation, ALL( Dates[Date]), ALLSELECTED(Dates[Date]), ALL(Dates) are same ignoring report filter, different with ALLSELECTED( Dates)

Cumulative Sales =

CALCULATE(

[Total Sales] ,

FILTER(

ALL( Dates[Date]),

Dates[Date] <= MAX( Dates[Date])))

 

Cumulative Sales 2 =

CALCULATE(

[Total Sales] ,

FILTER(

ALLSELECTED(Dates[Date]),

Dates[Date] <= MAX( Dates[Date])))

 

Cumulative Sales 3 =

CALCULATE(

[Total Sales],

FILTER(

ALL(Dates),

Dates[Date]<=MAX(Dates[Date])))

 

Cumulative Sales (Selected) =

CALCULATE( [Total Sales] ,

FILTER(

ALLSELECTED( Dates),

Dates[Date] <= MAX( Dates[Date])))

 

2. But for calculation of all dates, ALL(Dates[Date]), ALLSELECTED(Dates[Date]), ALLSELECTED(Dates) are same with report filter working, different with ALL( Dates)

 

Total Sales (all selected) =

CALCULATE( [Total Sales] , all( Dates[Date] ))

 

Total Sales (all Selected) 2=

CALCULATE( [Total Sales] , ALLSELECTED( Dates[Date] ))

 

Total Sales (all selected)3 =

CALCULATE( [Total Sales] , ALLSELECTED( Dates))

 

Total Sales (all) =

CALCULATE( [Total Sales] , ALL( Dates))

Picture1.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lilyyan,

 

I think I found the reason, please take a look at below  test steps.

 

Measure used to display the current row count.

All(Table)/All(Column)/AllSelected(Table)/Allselected(Column) = COUNTROWS(ALL(Dates))&"-"&COUNTROWS(ALL(Dates[Date]))&"-"&COUNTROWS(ALLSELECTED(Dates))&"-"&COUNTROWS(ALLSELECTED(Dates[Date]))

2.PNG

 

 

1. Calculate the real count by year filter and quarter filter.

1.PNG

 

Result: allselected table work, allselected column not work.

 

2. Test with date slicer.

3.PNG

 

Result: allselected(table) and allselected(column) works.

 

3. Test with date slicer and line chart.

4.PNG

 

In summary, when you use allselected function, you should remember allselected(table) can works on all of its columns, but allselected(column) only works on the slicer with specify column as the source.

 

Regards,

Xiaoxin Sheng

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @lilyyan,

 

Can you provide the pbix file to test? I'm not very clear for your measure "Total Sales".

 

Regards,

Xiaoxin Sheng

@AnonymousSorry that I don't know how to attach the file here. It's downloaded as mentioned in post: Understanding Your Customers from http://enterprisedna.co/power-bi-resources. 

 

The source data file as below, including one row named Total Revenue. And Total Sales = SUM(Sales[Total Revenue])

:Capture.PNG

 

@Anonymouspls refer to the pbxi file here

Anonymous
Not applicable

Hi @lilyyan,

 

I think I found the reason, please take a look at below  test steps.

 

Measure used to display the current row count.

All(Table)/All(Column)/AllSelected(Table)/Allselected(Column) = COUNTROWS(ALL(Dates))&"-"&COUNTROWS(ALL(Dates[Date]))&"-"&COUNTROWS(ALLSELECTED(Dates))&"-"&COUNTROWS(ALLSELECTED(Dates[Date]))

2.PNG

 

 

1. Calculate the real count by year filter and quarter filter.

1.PNG

 

Result: allselected table work, allselected column not work.

 

2. Test with date slicer.

3.PNG

 

Result: allselected(table) and allselected(column) works.

 

3. Test with date slicer and line chart.

4.PNG

 

In summary, when you use allselected function, you should remember allselected(table) can works on all of its columns, but allselected(column) only works on the slicer with specify column as the source.

 

Regards,

Xiaoxin Sheng

@Anonymousthanks for the explanation. 

 

When drilling down into different filter/slicer, it's confused again. The pbix file is shared here

I renamed all referred measures for better understanding. And then I selected the filters/slicers step by step: Page filter: Year = 2014, 2015, 2016 -> Slicer: Year = 2015 -> Slicer: Date = 8/3/2014-6/28/2015. The results after every step are quite confusing. 

And now my main confused point is the difference between **bleep** and All for all-column and allselcted column. 

Can u have a check and see why? Untitled.png

 

 

Anonymous
Not applicable

Hi @lilyyan,

 

In my opinion, I'd like to suggest you to test with single date slicer. I'm not so sure the interaction of multiple slicers and filters if they will affect the measure calculation.

 

Regards,

Xiaoxin Sheng

Hi, @Anonymous

I tried with single slicers, exactly same, no change.Man Sad

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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