DAX 'ALL' Function

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a question regarding the ALL function, in MS DOCS they have the construction,

Excel Formula:
Titel :=
SUMX ( ResellerSales_USD, ResellerSales_USD[SalesAmount_USD] )
    / SUMX ( ALL ( ResellerSales_USD ), ResellerSales_USD[SalesAmount_USD] )

But if you use ALL is returns a table of distinct values and removes filters so
eg SUMX( ALL( Table, Table Numbers),Table Numbers ) where the numbers are 1, 2,, 2, 3, 4 would see 1,2,3,4 so I don't see how this can
be correct? What am I missing?

Richard.
 
It's pretty logical isn't it? Why would you want/need duplicated values in a specific column returned for a filter context?
Still somewhat confused.
"ALL(Table) returns all of the values in the table". All of the values <> all of the distinct values.
I never paid much attention to it since I hardly need to use ALL at all. Seems it is time to practice some more.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I think the point is that the situations where you would use ALL(Table) you would typically just want all the records in the table (and creating a unique set based on all columns could be very computationally expensive). When you use ALL(column) you would typically only need a unique list because you'd normally be using the result as a filter table.
 
Upvote 0
Solution
It's pretty logical isn't it? Why would you want/need duplicated values in a specific column returned for a filter context?
Well yes, but if you just put ALL (Table) , you do
Below two accounts of item b unit 5 .
1654538620211.png


This really just started as wanting a measure SUM( units ) / SUMX(ALL( Table), Table units, and I put
Table [ Units ] into ALL and of course did not get the correct result.

Richard.
 
Upvote 0
My point was about the ALL(column) syntax. You would not typically want or need duplicated values back from that.
 
Upvote 0
Never do that with DAX; you'll go mad. ;)
 
Upvote 0

Forum statistics

Threads
1,223,657
Messages
6,173,629
Members
452,525
Latest member
DPOLKADOT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top