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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ephramz
Helper II
Helper II

Creating a measure relating data

Hi, I have two tables which have columns (Strategy) and (Package) which contains related data.

I wish to create a measure, to compare/relate the columns in strategy and package between both table and use the 'correct time' column to minus the 'average time' column. How can I do that ?

 

E.g if Table 2 and Table 1 has the same Strategy and package names/codes, 'SL2120' Strategy and 'AA' Package, take the value 15.3 minus 14.3 which should give 1.0.

Table 1  Table 2 
StrategyPackageAverage Time StrategyPackageCorrected Time
SL2120AA14.3 SL2120AA15.3
SL2123AB12.4 SL2123AB14.5
SL2124AC12.5 SL2124AC12.2
SL2125AD12.5 SL2125AD15.4
SL2126AE12.6 SL2126AE16.4
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @ephramz 

1. Place Table1[Strategy] and Table1[Package] in a table visual

2. Place this measure in the visual

See it all at work in the attached file.

Measure = 
VAR avgTime_ = SELECTEDVALUE ( Table1[Average Time] )
VAR corrTime_ =
    CALCULATE (
        MAX ( Table2[Corrected Time] ),
        TREATAS (
            SUMMARIZE ( Table1, Table1[Strategy], Table1[Package] ),
            Table2[Strategy],
            Table2[Package]
        )
    )
RETURN
corrTime_ - avgTime_

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @ephramz 

1. Place Table1[Strategy] and Table1[Package] in a table visual

2. Place this measure in the visual

See it all at work in the attached file.

Measure = 
VAR avgTime_ = SELECTEDVALUE ( Table1[Average Time] )
VAR corrTime_ =
    CALCULATE (
        MAX ( Table2[Corrected Time] ),
        TREATAS (
            SUMMARIZE ( Table1, Table1[Strategy], Table1[Package] ),
            Table2[Strategy],
            Table2[Package]
        )
    )
RETURN
corrTime_ - avgTime_

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.