I am trying to create a new measure within Power BI and although the syntax I have is correct in the example below, the value is way off what it should be which suggests the calculation is incorrect. I'm not too sure how to amend this to show the correct logic.
This is what I currently have. Any help is would be appreciated, please.
What I am trying to say is, is the amended_amount is less than or equal to 100,000, then 100,000 minus sum(app_value - comp_value)
cost = SUMX ( fact_cost, SWITCH ( TRUE (), CALCULATE(fact_cost[amended_value]) <=100000, calculate(100000 - SUM(fact_cost[app_value]) - sum(fact_cost[comp_value]) )))
fact_cost
and every row that hasfact_cost[amended_value]) <=100000
fulfills calculation -100000 -fact_cost[app_value]- fact_cost[comp_value]
(all values comes from a current row not from a table) all other are zero value. Then the result of the calculation is added to a total. It's likeSUMX=(row1_result+row2_result + ....)
. If it is not what you want then give a formula or a sample result – Mik