cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
benjaminhoang
Helper III
Helper III

Adding 3 columns together to get a total to show on a card

Hello,


WE are trying to track how much work is contracted out. All numbers that start with 1 in STEP 1, 2, 3 belong to our company everything us else is contracted out. We would like to count everything that does not start with 1 so it can be shown on a card.

 

STATUSTRIPSTEP 1STEP 2STEP 3TOTAL ?
CompleteP26332126126GO928
CompleteP26321126126TRACT
completeD84470101101DFG
CompleteD84416114107SDF
CompleteD84457116108132
completeD84523121123234
completeD84557109109123
completeD84405120TRACT874
completeD84505GO123102 
completeP26345110110 
completeD84534108108 
completeD84533118118234
CompleteP26344107107534
CompleteP26318101101123
completeP26343429429133
completeP26313124124 
completeP26340114114456
completeP26341108108123
1 ACCEPTED SOLUTION

Then you should add that condition to the formula, it would look something like:

TOTAL = IF(ISBLANK(STEP1)=TRUE,0,IF(LEFT(STEP1,1)="1",0,1))+IF(ISBLANK(STEP2)=TRUE,0,IF(LEFT(STEP2,1)="1",0,1))+IF(ISBLANK(STEP3)=TRUE,0,IF(LEFT(STEP3,1)="1",0,1))

 

Let me know if it works

View solution in original post

3 REPLIES 3
alexvc
Resolver I
Resolver I

I'm not sure if I follow, but I think you can calculate that as a column by means of a formula like: TOTAL = IF(LEFT(STEP1,1)="1",0,1)+IF(LEFT(STEP2,1)="1",0,1)+IF(LEFT(STEP3,1)="1",0,1)

 

This will give you the sum in the total field of subcontracted steps per trip

 

 

Hey @alexvc  this works well but I forgot to ask can we have blanks not be included in the sum but rather be treated as our drivers who start with 1. I tried to change it myself but failed.

Then you should add that condition to the formula, it would look something like:

TOTAL = IF(ISBLANK(STEP1)=TRUE,0,IF(LEFT(STEP1,1)="1",0,1))+IF(ISBLANK(STEP2)=TRUE,0,IF(LEFT(STEP2,1)="1",0,1))+IF(ISBLANK(STEP3)=TRUE,0,IF(LEFT(STEP3,1)="1",0,1))

 

Let me know if it works

Helpful resources

Announcements
Power BI Show Ep 4 Post Show Carousel.jpg

The Power BI Community Show

Shabnam Watson demos Incremental refresh & Hybrid Tables and Leila Etaati demos Charticulator.

PBI April Release 2022 768x460.png

Check it out!

Click here to read more about the April 2022 updates!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!