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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
SachinC
Helper V
Helper V

Advanced Filtering and Custom Formulae

Hi,

I have some project data in Excel that I report on using PowerBI.

Here's a snippet of the data and some information on what I wish to do:-

 

Requirement: Duration Days excluding 'Pushout'. For example, Task Title 'ABC', I want to calculate all Duration days but exclude #=2 (which is a repeat) and any occurance of 'Pushout'. So, for Task Title: ABC, 32 - 24 = 8 days. How do I write a formula to get 8 days?

 

I look forward to your response.

Thank you.

Sachin

 

IDDate of Export#Task ModeCost% CompleteTask TitleTask NameDurationStartFinishPredecessors
26004/09/20171Auto Scheduled£3,850.000%ABCABC32 daysWed 23/08/17Thu 05/10/17 
26104/09/20172Auto Scheduled£3,850.000%ABCABC32 daysWed 23/08/17Thu 05/10/17 
26204/09/20173Auto Scheduled£0.000%ABC      Pushout24 daysWed 23/08/17Mon 25/09/17 
26304/09/20174Auto Scheduled£850.000%ABC      SCOPE1 dayTue 26/09/17Tue 26/09/172
26404/09/20175Auto Scheduled£0.000%ABC      INVOICE3 daysWed 27/09/17Fri 29/09/173
26504/09/20176Auto Scheduled£1,700.000%ABC      BUILD2 daysMon 02/10/17Tue 03/10/174
26604/09/20177Auto Scheduled£450.000%ABC      TEST1 dayWed 04/10/17Wed 04/10/175
26704/09/20178Auto Scheduled£850.000%ABC      DEPLOY1 dayThu 05/10/17Thu 05/10/176
26804/09/20171Auto Scheduled£24,350.000%DVCDVC68 daysWed 23/08/17Fri 24/11/17 
26904/09/20172Auto Scheduled£24,350.000%DVCDVC68 daysWed 23/08/17Fri 24/11/17 
27004/09/20173Auto Scheduled£0.000%DVC      Pushout35 daysWed 23/08/17Tue 10/10/17 
27104/09/20174Auto Scheduled£0.000%DVC       SCOPE1 dayWed 11/10/17Wed 11/10/172
27204/09/20175Auto Scheduled£0.000%DVC       INVOICE1 dayThu 12/10/17Thu 12/10/173
27304/09/20176Auto Scheduled£21,250.000%DVC       BUILD25 daysFri 13/10/17Thu 16/11/174
27404/09/20177Auto Scheduled£2,250.000%DVC       TEST5 daysFri 17/11/17Thu 23/11/175
27504/09/20178Auto Scheduled£850.000%DVC       DEPLOY1 dayFri 24/11/17Fri 24/11/176
1 ACCEPTED SOLUTION

I worked in the end. Rubbish PowerBI - the visual I had didn't work, so I created a new one and it worked.  Please fix this in the next release of PowerBi as it was driving me insane! Thanks for your help.

View solution in original post

7 REPLIES 7
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @SachinC,

 

Try this formula please. I didn't find out what kind of characters ahead some of the "Task Name". So I used a function "Right".

Measure =
VAR allDuration =
    CALCULATE ( SUM ( Table1[Duration.1] ), 'Table1'[#] = 1 )
VAR Pushout =
    CALCULATE (
        SUM ( Table1[Duration.1] ),
        RIGHT ( 'Table1'[Task Name], 7 ) = "Pushout"
    )
RETURN
    allDuration - Pushout

The Duration isn't numbers. We need to transfer it first. Advanced Filtering and Custom Formulae1.jpg

 

Advanced Filtering and Custom Formulae2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale,

Good suggestions - however it's not doing the trick. I need to also negate #=2 as this is a repeat for #=1 - does that make sense?

I look forward to your response.

Regards,

S

Hi @SachinC,

 

I kick the #=2 out in the formula directly. So we don't need to care #=2. What's your idea? You can try one and see the result.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes _ i know you strip out #=2, however it's not working for me still. Let me have another try again, but thanks for your help.

I'm just wondering what checking routine, via formulae, I can plug in to test? Can you help me with this?
Thank you.

Quick question: It's not doing this: right ( Sheet1[Task Name], 4 ) = "Test") (I replaced 'Pushout' to 'Test') and it's not working. Help please? Thanks.

I worked in the end. Rubbish PowerBI - the visual I had didn't work, so I created a new one and it worked.  Please fix this in the next release of PowerBi as it was driving me insane! Thanks for your help.

Quick question: It's not doing this: right ( Sheet1[Task Name], 4 ) = "Test") (I replaced 'Pushout' to 'Test') and it's not working. Help please? Thanks.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.