cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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 Name Total Achievement ROI Quarter Project Category Rockstar Games 240.00% 13110.57% Q4 Enabler Rockstar Games 70.00% 13110.57% Q3 Risk Area Rockstar Games 0 13110.57% Q1 Risk Area Rockstar Games 0 13110.57% Q2 Risk Area Bethesda 70.00% 162.77% Q3 Risk 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
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

2 REPLIES 2
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.

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors