Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate Not working

Hi All,  I have 2 tables: Projects and Risks where a 1:many relationship exists from Projects:Risks. The Risk table has a status column which is of type Choice ( 3 values): Active, Closed, Postponed...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,Anonymous .Hello,Greg_Deckler,thanks for your concern about this issue.
    And I would like to share some additional solutions below
    I am glad to help you
    There seems to be an error in your dax code, you can try this measure:

    M_result = 
    VAR _onlyactive =
    CALCULATE(COUNT ( Risk[Project ID]), FILTER( 'Risk',Risk[pmotest_riskstatus] = "646440000" && Risk[pmotest_riskstatus_display] = "Active"))
    RETURN    
        _onlyactive
    

     

    In the calculate () function, the expression to be evaluated should not use variables as much as possible.


    here is my test result



    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.