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
agbaya
New Member

creating calculated row in a table which shares same table column headers

Hello community - i need your expertise.

I have a table which 'll love to create new calculated rows to get variance between 2 reporting period e.g. variance between reporting period 1 and period 2

Reporting periodTeamBudgetActual ITDFinal forecast
Period 1team110512
Period 1team215712
Period 1team320920
Period 2team110712
Period 2team215913
Period 2team3201317

 

What i intend to create in pbi is a table that looks like below..... intention is to create calculated rows which calculates the variance between the 2 reporting period using existing filters

Reporting periodTeamBudgetActual ITDFinal forecast
Period 1team110512
Period 1team215712
Period 1team320920
Period 2team110712
Period 2team215913
Period 2team3201317
VARteam1020
VARteam2021
VARteam304-3

 

Although i've limited the rows to just 3 for these example in reality - i have about 900 rows for each period so hoping i dont have to create a row for each line?

 

Any suggestion would be appreciated.

 

Thank you

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

hi, @agbaya ;

Could you please tell me if your problem has been solved?

If it is, could you please mark the helpful replies as a solution to close this topic and help others can learn from it ?

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi @agbaya  , 

 

As @Fowmy said ,You could try to create three measure to calculate difference, as follows:

DiffBudget =
VAR _value =
    MAX ( [Budget] )
        - CALCULATE (
            MAX ( [Budget] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Team] ),
                [Reporting period] < MAX ( [Reporting period] )
            )
        )
RETURN
    IF (
        MAX ( [Reporting period] ) <> MINX ( ALL ( 'Table' ), [Reporting period] ),
        _value
    )
DiffActual IT =
VAR _value =
    MAX ( [Actual ITD] )
        - CALCULATE (
            MAX ( [Actual ITD] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Team] ),
                [Reporting period] < MAX ( [Reporting period] )
            )
        )
RETURN
    IF (
        MAX ( [Reporting period] ) <> MINX ( ALL ( 'Table' ), [Reporting period] ),
        _value
    )
DiffFinal =
VAR _value =
    MAX ( [Final forecast] )
        - CALCULATE (
            MAX ( [Final forecast] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Team] ),
                [Reporting period] < MAX ( [Reporting period] )
            )
        )
RETURN
    IF (
        MAX ( [Reporting period] ) <> MINX ( ALL ( 'Table' ), [Reporting period] ),
        _value
    )

The final output is shown below:

v-yalanwu-msft_0-1621936443951.png

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.  

Fowmy
Super User
Super User

@agbaya 

I think you should consider creating measures to show the variances between the selected 2 periods in your report. Creating variance rows and appending them to your table would not give you the options to visualize effectively.  You also mentioned 900 records, therefore try a measure approach.
 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks @Fowmy - would these measures be created as columns? could you expantiate how this would work.

 

Thanks for your help

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.