Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
Hi @Anonymous,
Could you please mark the proper answers as solutions?
Best Regards,
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
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |