Forum Discussion
Can't find Name
I want to create a calculated table to return earlier date if the logic is true but I am getting a error saying can't find of the columns.
please see screenshort
8 Replies
- az38
Community Champion
Hi Anonymous
pay attention to arguments. before IF statement should be a new column name
- AnonymousNot applicable
Please can you help little bit further az38
Below is my formula but its not working , I dont want to incluce [type] and [State] in my summarized columns as it return duplicates in my table :
Table 2 = SUMMARIZE('Table',[Value],"Last",IF(AND('Table'[Type]="cs-accelerator-CS Accelerator Assessment",'Table'[State]="Failed"),CONVERT(MIN('Table'[Date]),STRING),"No"))What I want returned is two columns: Value and New column from the IF statement, any thought ?
- amitchandak
Super User
Anonymous , Try like
Table 2 = SUMMARIZE('Table','Table'[Value],'Table'[Type],'Table'[State],'Table'[Date],"Measure",IF(AND('Table'[Type]="cs-accelerator-CS Accelerator Assessment",'Table'[State]="Failed"),CONVERT(MIN([Date]),STRING),"No"))
If your calculation (IF(...) ) work as measure it will work here.
If just want rename without any grouping then use selectcolumns
- AnonymousNot applicable
amitchandak thanks for your help, that works but returning everything from the main table I want to summarize , I would like to exclude Tpe, state as they are not making my output unique,
Please screenshot of what my output looks like, as you can see below, its returning two dates instead of returning just '14/01/2020' as the latest date:
Please see below what I would like my output to look like :
Value Measure ee6080d4-8942-ea11-a812-000d3a86d7a3 28/03/2020 a392711c-151c-ea11-a811-000d3a86d7a3 No 82ddcb3c-eb11-ea11-a811-000d3a86d545 No 0dd45e8f-a507-ea11-a811-000d3a86d6ba 26/02/2020 d476000d-d20a-ea11-a811-000d3a86d545 no 5e91e211-cd0a-ea11-a811-000d3a86d545 14/05/2020 - amitchandak
Super User
Anonymous , try to have a measure like this
Measure =
VAR __id = MAX ( 'Table'[Value] )
VAR __date = CALCULATE ( MAX( 'Table'[date] ), ALLSELECTED ( 'Table' ), 'Table'[Value] = __id )
RETURN CALCULATE ( Max ( 'Table'[date] ), VALUES ( 'Table'[Value ), 'Table'[Value] = __id, 'Table'[date] = __date )