Forum Discussion

sadiahsapiee's avatar
sadiahsapiee
Helper I
3 years ago
Solved

Dynamic value calculation based on input

Hi, I have below scenario, I have been tried more than a month to get the solution but still not successful :     in above table the total = 351 and I put in example 35004  User select Sal...
  • tamerj1's avatar
    3 years ago

    Hi sadiahsapiee 
    Please try

    Total Cost of Critical =
    VAR T1 =
        ADDCOLUMNS (
            VALUES ( 'Table'[Component] ),
            "@Cost", CALCULATE ( SELECTEDVALUE ( 'Table'[Cost] ) ),
            "@Category", [Category]
        )
    VAR T2 =
        FILTER ( T1, [@Category] = "Critical" )
    RETURN
        SUMX ( T2, [@Cost] )