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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Difference of value, in a same column against the month and ID

i need to calculate the difference between different months value budgets, and the result should be the difference of two month 
against the same ID. like, e.g., ID PE-262. Now i need to find the difference between March 23 - April 23=  Variance result should be agaisnt Latest Month e.g April.23.
Apr 23 - May 23=  Variance result should be agaisnt Latest Month e.g May.23
May 23 - june 23=  Variance result should be agaisnt Latest Month e.g June.23
and so on 
or 
cur Month (May.24)- Previous (Apr.24) = Variance in cur Month May.24 then
Apr.24 - Mar.24 = Variance in Apr.24  and so on  like difference of two months and result shoul be in that latest month

DescriptionIDVersionBudgetVariance
Reinforcement of Thuwal Town  KAUST 2PE-26201-Mar-2330,018,685.350
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Mar-235,339,111.000
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Mar-233,441,750.000
Salarie.Project Office TeamPE-262-01-001-0101-Mar-23909,050.000
Salaries Site Office TeamPE-262-01-001-0201-Mar-23791,350.000
Reinforcement of Thuwal Town  KAUST 2PE-26201-Apr-2330,018,685.35Mar.23-Apr.23
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Apr-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Apr-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Apr-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Apr-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-May-2330,018,685.35apr.23-may.23
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-May-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-May-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-May-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-May-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Jun-2330,018,685.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Jun-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Jun-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Jun-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Jun-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Jul-2330,018,685.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Jul-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Jul-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Jul-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Jul-23791,350.00 
PE-262PE-26201-Aug-2330,018,685.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Aug-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Aug-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Aug-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Aug-23791,350.00 
PE-262PE-26201-Sep-2330,018,685.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Sep-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Sep-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Sep-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Sep-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Oct-2329,016,727.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Oct-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Oct-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Oct-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Oct-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Nov-2329,017,027.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Nov-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Nov-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Nov-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Nov-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Dec-2329,018,487.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Dec-235,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Dec-233,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Dec-23909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Dec-23791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Jan-2429,018,487.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Jan-245,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Jan-243,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Jan-24909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Jan-24791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Feb-2429,018,487.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Feb-245,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Feb-243,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Feb-24909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Feb-24791,350.00 
Salarie.Site Support TeamPE-262-01-001-0301-Feb-241,054,500.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Mar-2429,073,487.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Mar-245,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Mar-243,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Mar-24909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Mar-24791,350.00 
Reinforcement of Thuwal Town  KAUST 2PE-26201-Apr-2429,073,487.35 
SITE MANAGEMENT\OVERHEAD COSTPE-262-0101-Apr-245,339,111.00 
SM1|SITE MANAGEMENT EXP - ADMINISTRATIPE-262-01-00101-Apr-243,441,750.00 
Salarie.Project Office TeamPE-262-01-001-0101-Apr-24909,050.00 
Salaries Site Office TeamPE-262-01-001-0201-Apr-24791,350.00apr.24-mar.24

 

3 REPLIES 3
Anonymous
Not applicable

Bilalmakki_1-1718873242112.png

Also for 2nd code it's showing circular dependency ?

Anonymous
Not applicable

Dear @VahidDM 
Thank you for your response,
as i have tried your first code, its not getting variance , as from data in Sep.23- Oct-23= Varaicne like 1 M agaist PE-262 ID , but its showing zero???

Bilalmakki_0-1718873062372.png

 

 

VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this:
Create a calculated column for previous month's budget:

PreviousMonthBudget = 
VAR CurrentDate = 'Table'[Version]
VAR PreviousMonthDate = EDATE(CurrentDate, -1)
RETURN
    CALCULATE(
        MAX('Table'[Budget]),
        'Table'[ID] = EARLIER('Table'[ID]),
        'Table'[Version] = PreviousMonthDate
    )

 

Create a calculated column for variance

Variance = 
IF(
    ISBLANK('Table'[PreviousMonthBudget]),
    BLANK(),
    'Table'[Budget] - 'Table'[PreviousMonthBudget]
)

 

 

Create a measure to display the variance for the latest month

LatestMonthVariance = 
VAR LatestMonth = CALCULATE(
    MAX('Table'[Version]),
    ALL('Table')
)
RETURN
IF(
    MAX('Table'[Version]) = LatestMonth,
    CALCULATE(
        SUM('Table'[Variance]),
        FILTER(
            'Table',
            'Table'[Version] = LatestMonth
        )
    ),
    BLANK()
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

LinkedIn|Twitter|Blog |YouTube 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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