cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RafaelAnnibale1
Frequent Visitor

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?

1 ACCEPTED SOLUTION

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

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@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?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors