Forum Discussion
nonex18
4 years agoNew Member
Dax Measure?
Hello!
So I have two tables here one has the Work Request#s
| Work Request# |
| ADO01 |
| ADO02 |
| ADO03 |
| ADO04 |
| ADO05 |
The second table suppose to have the work request statuses
| Work Request# | Status | Status Count |
| ADO01 | TODO | 0 |
| ADO01 | In Progress | 2 |
| ADO01 | Completed | 4 |
| ADO01 | Not Applicable | 7 |
| ADO02 | TODO | 1 |
| ADO02 | In Progress | 5 |
| ADO02 | Completed | 11 |
| ADO02 | Not Applicable | 12 |
| ADO03 | TODO | 0 |
| ADO03 | In Progress | 5 |
| ADO03 | Completed | 12 |
| ADO03 | Not Applicable | 8 |
| ADO04 | TODO | 0 |
| ADO04 | In Progress | 0 |
| ADO04 | Completed | 0 |
| ADO04 | Not Applicable | 0 |
| ADO05 | TODO | 0 |
| ADO05 | In Progress | 0 |
| ADO05 | Completed | 0 |
| ADO05 | Not Applicable | 0 |
So I need help to create a calculated column because the most current status is supposed to be the one with the highest Status count but if it is a new Work Request the default should be TODO but it does not have any status count upon creation. So the results should be like this
| Work Request# | Status |
| ADO01 | Not Applicable |
| ADO02 | Completed |
| ADO03 | Completed |
| ADO04 | TODO |
| ADO05 | TODO |
Thanks
Hi,
Please check the below picture and the attached pbix file.
It is for creating a calculated column.
Status CC = VAR _statuscountmax = MAXX ( RELATEDTABLE ( 'Status' ), 'Status'[Status Count] ) VAR _result = MAXX ( FILTER ( RELATEDTABLE ( 'Status' ), 'Status'[Status Count] = _statuscountmax ), 'Status'[Status] ) RETURN IF ( _statuscountmax = 0, "TODO", _result )
1 Reply
- Jihwan_KimSuper User
Hi,
Please check the below picture and the attached pbix file.
It is for creating a calculated column.
Status CC = VAR _statuscountmax = MAXX ( RELATEDTABLE ( 'Status' ), 'Status'[Status Count] ) VAR _result = MAXX ( FILTER ( RELATEDTABLE ( 'Status' ), 'Status'[Status Count] = _statuscountmax ), 'Status'[Status] ) RETURN IF ( _statuscountmax = 0, "TODO", _result )