Forum Discussion
Question on Extract Group Values
- 2 years ago
pls try this
Column = if(maxx(FILTER('Table','Table'[Sample]=EARLIER('Table'[Sample])&&'Table'[A]<>"NA"),'Table'[A])="",'Table'[B],'Table'[A])pls see the attachment below
ryan_mayu Just to confirm my understanding is correct.
The Filter function will create a virtual table for each identical Sample. Then the Maxx function will give the maximum row count for each identical Sample of the virtual table and the maximum row count of the Sample actual table that the column A is not NA. If both the max count of the tables are the same (not having NA), then the Column A is empty.
My questions is which code specify the compare of the max count of the virtual table and the table with column that is not NA? I am a bit of confuse, appreciate if you explain the breakdown the code.
do not think too much about max, if you change to min, the DAX will be still working. you can separate the DAX to see the output of each part.
check the output of
maxx(FILTER('Table','Table'[Sample]=EARLIER('Table'[Sample])&&'Table'[A]<>"NA")- Anonymous2 years agoNot applicable
ryan_mayu I tried to change the virtual table to NA and it will use to evaluate the the Food-A column is empty (using the Test5 column). However, why A3 is giving NA despite A3 row will appear in the virtual table and it also become True when being used to evaluate Food-A column is empty, thus it shoud display Food-B column value, choco.
- ryan_mayu2 years agoSuper User
my dax is <>"NA"
Column = if(maxx(FILTER('Table','Table'[Sample]=EARLIER('Table'[Sample])&&'Table'[A]<>"NA"),'Table'[A])="",'Table'[B],'Table'[A])