Forum Discussion
Need Help! Writing a Measure to multiply between two Fact Tables
I need to multiply two measures by each other. The challenge is the two measures are calculated against two different Fact Tables. The information in the two Fact Tables is indirectly related by a common Dimension Table. One measure represents a percentage, the other measure represents a Value calculated by multipling by another Percentage.
For each unique Value it needs to be multiplied by the appropriate Perecentage based on Site & Care Setting (Dimensions) to determine which Percentage to use to multiply the Value.
I've thought a great deal about this, I think maybe virtual tables are required, to pull all the data together, but it is escaping me.
The data models breaks into three clean star schemas with shared Dimension Tables. All one to many relationships with single direction filtering.
Help! 🙂
See screenshots below.
Sample data here.
Data ModelCalculation Flow Diagram
5 Replies
- amitchandak
Super User
Anonymous , These are the way you can work upon
What you need common dimension or dimesnion where you can multiply
In case you need one dimension
sumx(summarize(Dim, Dim[Dim], "_1", [Measure from Table1], "_2", [Measure from Tabl2]),[_1]*[_2])
In case you need more tha one dimensions
sumx(summarize(Table1,Dim[Dim], Dim2[Dim2], "_1", [Measure from Table1], "_2", [Measure from Tabl2]),[_1]*[_2])
- AnonymousNot applicable
amitchandak I'm not sure I follow what you're suggesting. Are you saying to use Summarize to calculate each measure and multiply the two results? In another Forum someone suggested using CROSSFILTER, however while that results in the mathematical operation properly occuring, it negates the filtering in the [Area by Care Setting Ratio] which results in the wrong amount of area being calculated.
- AnonymousNot applicable
Anyone....?