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 I am trying to digest your solution.
Can you explain a bit why we need to use Maxx to know whether column A of the Table is empty ('table'[A]="") ?
Is the code below means using the Filter context, I am checking is each row is the same value as previous row (using EARLIER) and if the current row is the same as previous row in the Sample column then check whether column A is not NA?
Table'[Sample]=EARLIER('Table'[Sample])&&'Table'[A]<>"NA"
max to check if there is not NA value in the same sample,. If we can find any other value except NA, that will return reuslt, if we can't find, that will return blank.
this is following your below logic:
The rule is if all values in Food-A is NA within the same sample
- Anonymous2 years agoNot applicable
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.- ryan_mayu2 years agoSuper User
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.