Forum Discussion
Measure controlled by Dimension
Thanks for the response - I dont think this will work. Let me give you an example.
I have a measure called VALUE, within that single measure is held both ACTUAL VALUE and BUDGET VALUE, the selection of which is controlled by selecting a member in another dimension calledd MEASURE_TYPE.
If i want a single gauge displayed which shows ACTUAL versus BUDGET, then i can only select one of these two measures to be shown within the gauge?
Would also be interested to see if anyone else has a cube designed this way?
kind regards
I do this frequently. I have a table called MeasureBehavior. In it is a single column, MeasureType. There are no relationships between this and other tables.
| MeasureType |
| Actual |
| Budget |
Maybe you'd have more rows if you wanted more measure swapping. "Loss", "Projection" etc.
I don't know what your data model is like but let's imagine you have a table called BudgetTable and a table called ActualTable, both with Amount columns that you want to sum up. Further, I'm going to assume that if neither "Actual" nor "Budget" is selected, or if more than of them is selected, you want this measure to do nothing at all, return blank. If not, substitute whatever you want it to do for both of the BLANK()s below.
Value = IF( HASONEVALUE(MeasureBehavior[MeasureType]), SWITCH( FIRSTNONBLANK(MeasureBehavior[MeasureType], 1), "Actual", SUM(ActualTable[Amount]), "Budget", SUM(BudgetTable[Amount]), BLANK() ), BLANK() )
If you already have measures written for Actual Value and Budget Value, substitute references to them for the SUM parts above.
- chrisbev9 years agoNew Member
Thanks for the reply - in your example, how would you plot (within PowerBI) a guage that showed Actual versus Budget?
cheers
Chris
- Anonymous9 years agoNot applicable
I thought you were asking for a gauge that you could control with a slicer, where it would switch between showing actual and budget. If you want to plot actual against budget on a gauge, why would you not just write a measure for actual and a measure for budget, then put them both on the gauge?
- chrisbev9 years agoNew Member
Agreed - the issue is that we already have a cube with the measures developed the way they have been, we can use this method within Pyramid Analytics as it allows that granularity of selection but did wonder if
a) PowerBI could handle it and
b) Whether many other people constructed their measures this way
cheers
Chris