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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
scowans
Frequent Visitor

Calculate Difference Between 2 Different Measure Parameter Fields

Hello,

I have a table which includes 4 different Versions for a budget headcount file, Client Account (A&B), Month Start Date and Headcount numbers (see table below)

 

VersionClientAccountMonthStartDateHeadcount
FY25 BudgetClient A1/1/2025100
FY25 BudgetClient A2/1/2025110
FY25 BudgetClient A3/1/2025120
April SnapshotClient A1/1/2025110
April SnapshotClient A2/1/2025120
April SnapshotClient A3/1/2025130
May SnapshotClient A1/1/2025120
May SnapshotClient A2/1/2025130
May SnapshotClient A3/1/2025140
CurrentClient A1/1/2025130
CurrentClient A2/1/2025140
CurrentClient A3/1/2025150
FY25 BudgetClient B1/1/2025200
FY25 BudgetClient B2/1/2025220
FY25 BudgetClient B3/1/2025240
April SnapshotClient B1/1/2025220
April SnapshotClient B2/1/2025240
April SnapshotClient B3/1/2025260
May SnapshotClient B1/1/2025240
May SnapshotClient B2/1/2025260
May SnapshotClient B3/1/2025280
CurrentClient B1/1/2025260
CurrentClient B2/1/2025280
CurrentClient B3/1/2025300

 

The above table is connected to a Calender table linked on Month Start Date and I have 2 parameter field tables for measures which will allow users to select the measures from 2 sets of slicers they would like to see included in a matrix visual.  The 2 parameter fields have been added to the Values section in the field well for the matrix visual.  Below are the 2 parameter tables I have setup.

 

PrmVersion1 = {
    ("25 Budget", NAMEOF('Table1'[HC - FY25 Budget]), 0),
    ("25 Apr", NAMEOF('Table1'[HC - April Snapshot]), 1),
    ("25 May", NAMEOF('Table1'[HC - May Snapshot]), 2),
    ("Current", NAMEOF('Table1'[HC - Current]), 3)
}
 
PrmVersion2 = {
    ("25 Budget", NAMEOF('Table1'[HC - FY25 Budget]), 0),
    ("25 Apr", NAMEOF('Table1'[HC - April Snapshot]), 1),
    ("25 May", NAMEOF('Table1'[HC - May Snapshot]), 2),
    ("Current", NAMEOF('Table1'[HC - Current]), 3)
}
 
The measures are summing the Headcount field using filter context for the Version field (see example below).
HC - Current = CALCULATE (sum(Table1[Headcount]), 'Table1'[Version] = "Current")
 
Below is a screenshot for the current end result I was able to acheive.
scowans_1-1749253775629.png

I'm looking for some guidance for a way to show a field in the matrix which will calculate the difference between the values for the 2 measure field parameters that are being displayed in the matrix.  The Diff column in the below screenshot illustrates the desired result I'm looking to acheive when '25 Buget' is selected in the 1st slicer and 'Current' is selected in the 2nd slicer.

 

 Feb-25Jan-25Mar-25
ClientAccount25 BudgetCurrentDiff25 BudgetCurrentDiff25 BudgetCurrentDiff
Client A110140301001303012015030
Client B220280602002606024030060
Total330420903003909036045090

 

Or for example if '25 Buget' is selected in the 1st slicer and '25 May' is selected in the 2nd slicer the Diff column in the below screenshot illustrates the desired result I'm looking to acheive.

 

 Feb-25Jan-25Mar-25
ClientAccount25 Budget25 MayDiff25 Budget25 MayDiff25 Budget25 MayDiff
Client A110130201001202012014020
Client B220260402002404024028040
Total330390603003606036042060

 

Any guidance here would be much appreciated 😁. P.S. I'm also attaching a link to the pbix file.

Budget HC.pbix

 

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @DataNinja777, for your response.

Hi scowans,

We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding of your query, please find attached a screenshot and a sample PBIX file that may help resolve the issue:

vpnarojumsft_0-1749461711047.png

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

Should you have any further questions, please feel free to contact the Microsoft Fabric Community.

Thank you.




View solution in original post

3 REPLIES 3
v-pnaroju-msft
Community Support
Community Support

Thankyou, @DataNinja777, for your response.

Hi scowans,

We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding of your query, please find attached a screenshot and a sample PBIX file that may help resolve the issue:

vpnarojumsft_0-1749461711047.png

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

Should you have any further questions, please feel free to contact the Microsoft Fabric Community.

Thank you.




DataNinja777
Super User
Super User

Hi @scowans ,

 

Thank you for sharing the detailed question. While the current approach using pre-aggregated values and measure parameters may seem like a quick workaround—and is indeed commonly seen in many organizations 💦, including mine 😭—it doesn’t fully leverage the flexibility and scalability that DAX offers.

 

Headcount is typically best managed using an employee-level fact table with joining and leaving dates, combined with a disconnected calendar table. You can even handle budgeted and forecast headcount by including planned (dummy) rows with expected start and end dates. This structure allows for more accurate, dynamic reporting across versions, including hires, terminations, and backdated adjustments.

 

That said, if granular employee-level data isn’t currently available, I’d recommend treating this setup as a temporary workaround rather than a long-term solution. While it’s technically possible to calculate differences between selected parameter values, this approach tends to be fragile, harder to maintain, and limits deeper analysis. Investing in a proper data model will pay off significantly over time.

 

I’m sharing a link to my blog post on this topic below—hoping that one day this kind of model becomes the standard for headcount analysis:
🔗 Dynamic Headcount Analysis using Dax 

 

Best regards,

 

Hi @DataNinja777 ,

Thanks so much for your feedback here.  This is helpful.  My actual data model includes many more dimensions in the fact table including employee level detail to comprise the headcount numbers.  The data model info being referenced here is a simplified model using some sample data for just a few of the key dimensions to help illustrate the delima I'm trying to solve for to explore some of the possibilities and suggested approaches to calculate differences between selected parameter values as I'm new to using parameter fields and I'm trying to better understand the art of the possible.  Would it be possible to provide a suggested solution for the Diff calculation I'm trying to acheive?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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