Forum Discussion

RafaelAnnibale1's avatar
RafaelAnnibale1
Frequent Visitor
2 years ago
Solved

Help With a Calculated Column

I have this Calculated Column that is needed to register the risk category of each project. It does its job, but not entirely. I need to visualize information based on each project for each quarter. For example, in quarter 1, was that project a champion, enabler, performer, or in a risk area? I've developed this Calculated Measure: 

Risk Category =
VAR ProjectName = '5 - KPI & Benefit Achievement - All Zones Unpivot'[Project Name]
VAR TotalAchievement = '5 - KPI & Benefit Achievement - All Zones Unpivot'[Total Achievement]
VAR ROI = '7 - 2a - Global Benefit AC/LE - All Zones Unpivot'[ROI]
VAR Quarter = '5 - KPI & Benefit Achievement - All Zones Unpivot'[Quarter]

RETURN
SWITCH(
    Quarter,
    "Q1",
    SWITCH(
        TRUE(),
        TotalAchievement < 0.75 && ROI > 1, "Performer",
        TotalAchievement >= 0.75 && ROI < 1, "Enabler",
        TotalAchievement >= 0.75 && ROI > 1, "Champion",
        TotalAchievement < 0.75 && ROI < 1, "Risk Area",
        BLANK()
    ),
    "Q2",
    SWITCH(
        TRUE(),
        TotalAchievement < 0.75 && ROI > 1, "Performer",
        TotalAchievement >= 0.75 && ROI < 1, "Enabler",
        TotalAchievement >= 0.75 && ROI > 1, "Champion",
        TotalAchievement < 0.75 && ROI < 1, "Risk Area",
        BLANK()
    ),
    "Q3",
    SWITCH(
        TRUE(),
        TotalAchievement < 0.75 && ROI > 1, "Performer",
        TotalAchievement >= 0.75 && ROI < 1, "Enabler",
        TotalAchievement >= 0.75 && ROI > 1, "Champion",
        TotalAchievement < 0.75 && ROI < 1, "Risk Area",
        BLANK()
    ),
    "Q4",
    SWITCH(
        TRUE(),
        TotalAchievement < 0.75 && ROI > 1, "Performer",
        TotalAchievement >= 0.75 && ROI < 1, "Enabler",
        TotalAchievement >= 0.75 && ROI > 1, "Champion",
        TotalAchievement < 0.75 && ROI < 1, "Risk Area",
        BLANK()
    ),
    BLANK()
)


But the information is wrong. Because how it is returning me: 

Project NameTotal AchievementROIQuarterProject Category
Rockstar Games240.00%13110.57%Q4Enabler
Rockstar Games70.00%13110.57%Q3Risk Area
Rockstar Games013110.57%Q1Risk Area
Rockstar Games013110.57%Q2Risk Area
Bethesda70.00%162.77%Q3Risk Area


By following the rules, the first should be a Champion, and all the others should be a Performer. The logic is: How can I fix it to work considering each and every one of the quarters for every project?

  • Total Achievement is a column inside the table: 5 - KPI & Benefit Achievement - All Zones Unpivot
    The ROI V2 is a calculated measure. 
    I'm using the switch because the quarters are not all the same, i've quarter 1,2,3, 4 and each and every one of the quarter has a different values corresponding the roi and total achievement

2 Replies

  • RafaelAnnibale1 First it is not sure if you are adding a column or a measure and also if all the values you are checking ROI, and Total Achievements are columns or measures.

     

    2nd, if all the quarters have the same logic (looks like) why you have a SWITCH to check Quarter value?

    • RafaelAnnibale1's avatar
      RafaelAnnibale1
      Frequent Visitor

      Total Achievement is a column inside the table: 5 - KPI & Benefit Achievement - All Zones Unpivot
      The ROI V2 is a calculated measure. 
      I'm using the switch because the quarters are not all the same, i've quarter 1,2,3, 4 and each and every one of the quarter has a different values corresponding the roi and total achievement