calculated flag
1 TopicProblem with calculating the SUM of a calculated Flag Measure
Hi, Could someone help me please with my DAX calculation, it's not working out the way I expect. I have a number of KPIs and I'm evaluated them against a target and if they meet the target I flag them with 1. I want to sum all the KPIs that have met target but when I do they all return 1. Ultimately I would like to calculate a percentage of the KPIs that have met the Target. So in the case below it should be 50% of KPIs have met target. The KPITargetMet Measure works, but the TargetMetSum isn't working properly. When I create a percentage it says 100% have made target, which is incorrect. Here is the DAX code I'm using for the Measures. KPITargetMet = VAR KPIType = SELECTEDVALUE(MeasureData[KPITargetDiffDirectionUpper]) VAR KPIMeasure = [Measure] VAR KPITarget = [Target] RETURN IF(KPIType="HIGHER", IF(KPIMeasure >= KPITarget, 1, 0), IF(KPIType="LOWER", IF(KPIMeasure <= KPITarget, 1, 0),0)) TotalKPI = CALCULATE(DISTINCTCOUNT(MeasureData[KPIsCode])) TargetMetSum = CALCULATE(DISTINCTCOUNT(MeasureData[KPIsCode]), FILTER(MeasureData, [KPITargetMet]=1)) Hope this make sense. Thanks AngeloSolved1.4KViews0likes3Comments