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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
bcobrien77
Helper I
Helper I

variance between cost centers

Hi,

I am trying to create a variance so that I can compare two cost centers on their actual financial performance.

I have basically 100 cost centers with a few years of financial data and what I am trying to compare is

Property A                   Property B                  Variance

Total Expenses      Total Expenses        Property A Total Expenses – Property B Variances.

 

 

Ideally the user would be able to select the properties from two different slicers or one if it is easier.

I am definitely stuck on how to achieve this so thanks in advance.

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @bcobrien77,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

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

I would have 2 tables with your properties, just the property names and not related to one another or to any other table. You could create these from your fact table by doing something like:

Property1 = DISTINCT('Fact'[Column])
Property2 = DISTINCT('Fact'[Column])

Once you have those, then you can create a measure like:

 

Measure =
VAR __propertyA = MAX('Property1'[Column])
VAR __propertyB = MAX('Property2'[Column])
VAR __tableA = FILTER('Fact',[Column] = __propertyA)
VAR __tableB = FILTER('Fact',[Column] = __propertyB)
RETURN
SUMX(__tableA,[Expenses]) - SUMX(__tableB,[Expenses])

Without actual sample data, not sure I can be more specific. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks. The measure works but because the slicers are not updating so that I am only seeing two properties with the variances being caluclated between those two properties only. 

 

Instead I am getting all of the properties and am unable to make sense of the calculation

 

 

Are you sure that the tables should not be related to anything else?

Thanks

 

Yes, pretty sure. See attached.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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