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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
etwa702
Frequent Visitor

Calculate % increase or decrease by filtired values

Hello all

 

Submitted a previous question to which @Nathaniel_C  helped me out (thank again)

 

I am looking for a way to calculate % diffirence between two values. This could be a % increase or decrease based on the values. My previous question was to calculate % diffirence, but i soon realised i needed % varience instead.

 

Some background:

 

- We are running a project for a in house web app we have created. The Web app consists of multiple transaction pages and averages are calculated per page. (sample of data below)

- The aim is to run load tests against the page and use PBI to compare test run averages per page [Transaction Name] so we can see which test runs performed best and by how much, we could then justify code changes from the DEV team on the issues.

- Test runs have their own unique index number.

- The load tests could be done hourly or daily so the dataset will grow quite allot.

 

>Each test is listed as "Build"

>Each page is listed as "Tranaction Name"

>Each Transaction name have a "Average Response Time"

>Each Build has a Data and Time Column

>I also added a Test Run Index since I was hoping to use it as a method for my calculation

 

I need to be able to bring in a new column that can calculate the % varience between the "AvG Response Time" between test runs.

 

What make this complex for me is that I need to be able to consider that where the new build is better it should show it in a Positive % and bring in another column stating which build is the "Winning build". So there needs to be some way to compare which build is the new and old one. We might also want to be able to compare more that just 2 builds against each other.

 

I am presenting data on the PBI report using the Matrix visual and I would like it to show something like this.

Below is my sample file

 

Sample data

 

Test RunFEB Final 5/10/2019 9:01 AMFEB Final 5/9/2019 9:51 AM  
Transaction nameCurrent AverageCurrent AverageDiffirence of% Change
KCW01_01_HomePage4400%
KCW02_01_EngagementDashboard65116.67%
KCW03_01_EngagementScreen5500%
KCW04_01_AtlasDashboard8800%
KCW04_02_AuditPlanningHomePage9900%
KCW04_03_PreEngagement87112.50%
KCW04_04_Strategy222029.09%
KCW05_01_RiskAsssessmentHomePage1010and so onand so on
KCW05_02_EntityanditsEnvironment1111and so onand so on
KCW05_03_MinutesHomePage1010and so onand so on
KCW05_04_PlanningAnalytics66and so onand so on
KCW05_05_Inquiries44and so onand so on
KCW05_06_BusinessProcess33and so onand so on
KCW05_07_RAPD33and so onand so on
KCW09_01_MaterialityHomePage98and so onand so on
KCW09_02_DetermineMateriality66and so onand so on
KCW09_03_DeterminePMHomePageLoad87and so onand so on
KCW10_01_PRP99and so onand so on
KCW12_01_FraudHome99and so onand so on
KCW12_02_FraudRiskAssessment77and so onand so on
KCW12_03_Response33and so onand so on
KCW13_01_01_CeramicNonIntegratedLoad86and so onand so on
KCW13_01_05_UnderstandingofITLoad65and so onand so on
KCW14_01_IndependenceLandingPage109and so onand so on
KCW14_02_IndependenceHomePage1210and so onand so on
KCW14_03_ConfirmationsIESBA1312and so onand so on
KCW14_04_ConfirmationsPrivate43and so onand so on
KCW16_02_ProcessMapping00and so onand so on
KCW16_03_BalanceThis screen was not tested in this build so it should not calculate1BlankBlank

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @etwa702 ,

By my test based on your sample ,you could create the measure below.

% =
VAR a =
    CALCULATE (
        [Current Average],
        FILTER (
            ALLSELECTED ( 'Sample'[Test Run] ),
            'Sample'[Test Run] = "FEB Final 5/10/2019 9:01 AM"
        )
    )
VAR b =
    CALCULATE (
        [Current Average],
        FILTER (
            ALLSELECTED ( 'Sample'[Test Run] ),
            'Sample'[Test Run] = "FEB Final 5/9/2019 9:51 AM"
        )
    )
RETURN
    DIVIDE ( a - b, a )

Here is the output.

Capture.PNG

Hope this can help you.

In addition, please note that do not post your actual data here.

Best Regards,

Cherry

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

View solution in original post

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @etwa702 ,

By my test based on your sample ,you could create the measure below.

% =
VAR a =
    CALCULATE (
        [Current Average],
        FILTER (
            ALLSELECTED ( 'Sample'[Test Run] ),
            'Sample'[Test Run] = "FEB Final 5/10/2019 9:01 AM"
        )
    )
VAR b =
    CALCULATE (
        [Current Average],
        FILTER (
            ALLSELECTED ( 'Sample'[Test Run] ),
            'Sample'[Test Run] = "FEB Final 5/9/2019 9:51 AM"
        )
    )
RETURN
    DIVIDE ( a - b, a )

Here is the output.

Capture.PNG

Hope this can help you.

In addition, please note that do not post your actual data here.

Best Regards,

Cherry

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors