Forum Discussion
Urumita
3 years agoFrequent Visitor
Create boolean calculated column based on related table
Hi all, I need help with the following issue: My Data model has a table production items on the one side and Production steps on the other. Each Item goes through different steps in the product...
- 3 years ago
Urumita, Try the below steps,
- Add Status Code (Numeric)
- Success = 1
- In Progress = 2
- Faile = 3
- Create a Calculated Column in Item TBL_Items like below,
Status = VAR StatusCode = CALCULATE(MAX('TBL_Process'[Status Code]), RELATEDTABLE('TBL_Process')) VAR Result = SWITCH( StatusCode, 1, "Success", 3, "Fail", "In Progress" ) RETURN ResultNote: Make sure that you created a relationship between the tables.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!
MCT | Power BI Analyst | Azure Data Engineer
- Add Status Code (Numeric)
- SivaMani3 years agoResident Rockstar
Urumita, Try the below steps,
- Add Status Code (Numeric)
- Success = 1
- In Progress = 2
- Faile = 3
- Create a Calculated Column in Item TBL_Items like below,
Status = VAR StatusCode = CALCULATE(MAX('TBL_Process'[Status Code]), RELATEDTABLE('TBL_Process')) VAR Result = SWITCH( StatusCode, 1, "Success", 3, "Fail", "In Progress" ) RETURN ResultNote: Make sure that you created a relationship between the tables.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!
MCT | Power BI Analyst | Azure Data Engineer
- Urumita3 years agoFrequent Visitor
Thanks ShivaMani, worked perfectly!
- Add Status Code (Numeric)