Forum Discussion

sdg1393's avatar
sdg1393
Frequent Visitor
3 years ago
Solved

Help needed to identify the threshold

Hi,  I need a design and DAX help for the following requirement -   I have two tables - one is master table with kpi id, category, kpi name and threshold value lower and threshold value upper and t...
  • Sahir_Maharaj's avatar
    3 years ago

    Hello sdg1393,

     

    Can you please try this:

     

    1. Ensure that you have established a relationship between the master table and the summary table based on the "Kpi id" field

    2. Calculate the Percent Calculation

    PercentCalc = DIVIDE(SUM(Summary[numerator]), SUM(Summary[denominator])) * 100

    3. Identify whether the KPI is Increasing or Decreasing

    KPIType = SELECTEDVALUE(Master[type])

    4. Create Conditional Formatting Rules

    WithinThreshold = 
    SWITCH(
       TRUE(),
       [PercentCalc] >= SELECTEDVALUE(Master[threshold lower]) && [PercentCalc] <= SELECTEDVALUE(Master[threshold max]), 1,
       0
    )

    5. Create another measure to assign a color based on the KPI type and whether the value is within the threshold range

    ColorIndicator = 
    SWITCH(
       TRUE(),
       [KPIType] = "Increasing" && [WithinThreshold] = 1, "Green",
       [KPIType] = "Decreasing" && [WithinThreshold] = 1, "Red",
       "Yellow"
    )