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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alexjaco
Frequent Visitor

Applying a percent Increase to a only values select by a parameter

Hi, 

 

I am looking for a formula to apply a percent increase to my [Cycle Time (Hrs)*] based on the task selected by a parameter and return all other [Cycle Time (Hrs)*] without the percent increase.  The parameter is [Selected Task] and the 'Percent Increase to Cycle Time'[Percent Increase to Cycle Time Value] is a percentage parameter as well. I have the following formula, but it doesn't work. 

 

IF([Selected Task]=SELECTEDVALUE(Sheet1[Task]), SUMX(Sheet1,SUM(Sheet1[Cycle Time (Hrs)*])*(1+'Percent Increase to Cycle Time'[Percent Increase to Cycle Time Value])), SUMX(Sheet1,SUM(Sheet1[Cycle Time (Hrs)*])))
 
 
1 ACCEPTED SOLUTION

Ah. I think the total may be correct but for the individual rows, we need to keep the filter context from the visual so that not all rows are the same value.

 

Try this:

Adjusting 1 Cycle Time (hrs) =
VAR SelectedTasks = VALUES ( Task[Task] )
RETURN
    CALCULATE (
        SUM ( Sheet1[Cycle Time (Hrs)*] ),
        KEEPFILTERS ( Sheet1[Task] IN SelectedTasks )
    ) * ( 1 + [Percent Increase to Cycle Time Value] )
        + CALCULATE (
            SUM ( Sheet1[Cycle Time (Hrs)*] ),
            KEEPFILTERS ( NOT ( Sheet1[Task] IN SelectedTasks ) )
        )

 

View solution in original post

7 REPLIES 7
AlexisOlson
Super User
Super User

You'll need a separate table for your task parameter.

 

This version should be more efficient than SUMX:

VAR SelectedTasks = VALUES ( ParamTask[Task] )
RETURN
    CALCULATE (
        SUM ( Sheet1[Cycle Time (Hrs)*] ),
        Sheet1[Task] IN SelectedTasks
    ) * ( 1 + 'Percent Increase'[Percent Increase] )
        + CALCULATE (
            SUM ( Sheet1[Cycle Time (Hrs)*] ),
            NOT ( Sheet1[Task] IN SelectedTasks )
        )

 

Thank you for the solution. I applied your formula, however it's now returning the selected ParamTask[Task] 

[Cycle Time (Hrs)*] to every task and applying the percent increase. So for example if Task A was selected then task B and C would now reflect Task A's [Cycle Time (Hrs)*] (with the percent increase applied).  

Hmm. Does your task parameter table have a relationship with Sheet1? (Parameter tables should be unrelated.)

Just now removed the relationship. Now it's summing all [Cycle Time (Hrs)*] and returning just that total value for each Task. 

I don't think I can easily diagnose without seeing more context, e.g., exactly which columns you're using in all the relevant visuals and the relationship diagram (etc.).

The table on the left are the cycle times per each task (the lowest level of detail). The table on the right is with the formula to apply the percent increase to just 1 task. 

 

alexjaco_0-1624398712472.png

 

Ah. I think the total may be correct but for the individual rows, we need to keep the filter context from the visual so that not all rows are the same value.

 

Try this:

Adjusting 1 Cycle Time (hrs) =
VAR SelectedTasks = VALUES ( Task[Task] )
RETURN
    CALCULATE (
        SUM ( Sheet1[Cycle Time (Hrs)*] ),
        KEEPFILTERS ( Sheet1[Task] IN SelectedTasks )
    ) * ( 1 + [Percent Increase to Cycle Time Value] )
        + CALCULATE (
            SUM ( Sheet1[Cycle Time (Hrs)*] ),
            KEEPFILTERS ( NOT ( Sheet1[Task] IN SelectedTasks ) )
        )

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.