cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Employee

## Create calculated column based on text and probability%

Trying to create a calculated column to show the expected/probable revenue impact from a pipeline.

This means the column should do a function as:

If Probability = "10% - StageA" then 0.1*"Estimated revenue",

If Probability = "30% - StageB" then 0.3*"Estimated revenue",

If Probability = "95% - StageC" then 0.95*"Estimated revenue",

How do I do that?

1 ACCEPTED SOLUTION
Super User

@MrKwanorama ,

``````Probable revenue =
SWITCH(
TRUE(),
'Tablename'[Probability] = "10% - StageA", 0.1*'Tablename'[Estimated revenue],
'Tablename'[Probability] = "30% - StageB", 0.3*'Tablename'[Estimated revenue],
'Tablename'[Probability] = "95% - StageC", 0.95*'Tablename'[Estimated revenue],
BLANK()
)``````

Thanks,

Proud to be a Super User!

2 REPLIES 2
Super User

@MrKwanorama ,

``````Probable revenue =
SWITCH(
TRUE(),
'Tablename'[Probability] = "10% - StageA", 0.1*'Tablename'[Estimated revenue],
'Tablename'[Probability] = "30% - StageB", 0.3*'Tablename'[Estimated revenue],
'Tablename'[Probability] = "95% - StageC", 0.95*'Tablename'[Estimated revenue],
BLANK()
)``````

Thanks,

Proud to be a Super User!

Employee

Hi sorry - accepted too soon.

Gives me:

Function 'SWITCH' does not support comparing values of type True/False with values of type number.

I have the Estimated Revenue as Decimal Number and Probability as Text.

Any suggestion?

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors