Forum Discussion
gauravnarchal
Post Prodigy
4 years agoSWITCH TRUE MEASURE
Hello, I want to create a SWITCH TRUE measure as below
IF TABLE1 CUST NO = TABLE2 CUST NO, (True)TABLE2 PROCESS, (False) MISSING
Tabel 1
| Cust. No. |
| 0001300103 |
| 0001300105 |
| 0001300106 |
| 0001300107 |
| 0001300108 |
| 0001300109 |
| 0001300110 |
Table 2
| Cust. No. | PROCESS |
| 0001300103 | Normal |
| 0001300105 | Normal |
| 0001300106 | Normal |
| 0001300107 | Normal |
| 0001300108 | FAX |
Hi gauravnarchal ,
You can directly create a lookup column in tbl1 like below :-
Column = var result = LOOKUPVALUE(_tbl2[PROCESS],_tbl2[Cust. No.],_tbl1[Cust. No.]) return IF(result = BLANK(), "Missing",result)Or in measure you can use below code:-
Measure = var result = CALCULATE(MAX(_tbl2[PROCESS]),FILTER(_tbl2,_tbl2[Cust. No.] = MAX(_tbl1[Cust. No.]))) return IF(result = BLANK(),"Missing",result)Refer the file below.
5 Replies
- Samarth_18
Community Champion
Hi gauravnarchal ,
You can directly create a lookup column in tbl1 like below :-
Column = var result = LOOKUPVALUE(_tbl2[PROCESS],_tbl2[Cust. No.],_tbl1[Cust. No.]) return IF(result = BLANK(), "Missing",result)Or in measure you can use below code:-
Measure = var result = CALCULATE(MAX(_tbl2[PROCESS]),FILTER(_tbl2,_tbl2[Cust. No.] = MAX(_tbl1[Cust. No.]))) return IF(result = BLANK(),"Missing",result)Refer the file below.
- gauravnarchal
Post Prodigy
Samarth_18 - If the result is true I want to return TABLE2 PROCESS, (False) MISSING
- Samarth_18
Community Champion
gauravnarchal is this the expected output you need? if not please share expected output with example.