Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
FabAug
Regular Visitor

Calculate a new column with conditions

Hello Everybody

 

 

I want to calculate a column with a condition. I want to make a SUM of several columns with one condition like this:

 

IF [Estado] = "Pagado"  THEN SUM ([Pago]+[Pago2]+[Pago3]+[Pago4]+[Pago5])

 

IF [Estado] = "En Proceso" THEN DON'T SUM.

 

I'm new on this thanks for your comments.

 

2 ACCEPTED SOLUTIONS
askelton
Resolver I
Resolver I

I believe you could do something like.

 

if([Estado ="Pagado", [Pago] + [Pago2] + [Pago3] + [Pago4] + [Pago5])

View solution in original post

Anonymous
Not applicable

Hi @FabAug,

 

I think switch function will suitable for your requirement.

Sample:

Result =
SWITCH (
    [Estado],
    "En Proceso", "",
    "Pago", [Pago],
    "Pago2", [Pago2],
    "Pagado", [Pago] + [Pago2]
        + [Pago3]
        + [Pago4]
        + [Pago5]
)

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @FabAug,

 

I think switch function will suitable for your requirement.

Sample:

Result =
SWITCH (
    [Estado],
    "En Proceso", "",
    "Pago", [Pago],
    "Pago2", [Pago2],
    "Pagado", [Pago] + [Pago2]
        + [Pago3]
        + [Pago4]
        + [Pago5]
)

 

Regards,

Xiaoxin Sheng

askelton
Resolver I
Resolver I

I believe you could do something like.

 

if([Estado ="Pagado", [Pago] + [Pago2] + [Pago3] + [Pago4] + [Pago5])

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors