Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculated Column in One table based on the other table in Power BI

I have below two tables "Project Details" and "Issues" linked with a relationship field Project ID.     You can see the issues are available for Project IDs 1, 2 and 3.   Now I need to cre...
  • amitchandak's avatar
    amitchandak
    5 years ago

    Anonymous , Try

    new column =
    var _max = maxx(relatedtable(issues), isssues[Issue Priority])
    return
    switch(true(),

    isblank(_max), "Green",
    _max = 5, "Red",
    _max in {3,4}, "Yellow",
    _max in {1,2}, "Green"
    )

     

     

    or

     

     

    new column =
    var _max = maxx(relatedtable(issues), isssues[Issue Priority])+0
    return
    switch(true(),

    _max = 0, "Green",
    _max = 5, "Red",
    _max in {3,4}, "Yellow",
    _max in {1,2}, "Green"
    )