Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculation groups using 2 measures for Selectedmeasure() possible?

Hi all,

 

I have a challenge applying calculation groups that I hope you can help me with. I have attached a snapshot of my data set below:

 

 

 

The version columns tell us if the numbers are actual values or budgeted numbers. The actual/outlook columns tell us if the value is an actual number, our latest forecast (Outlook), or the forecast we made last month (Outlook LM).

 

So I have a measure picking up Actual/Outlook numbers compared to a comparison measure that picks up budget numbers, actuals from the past years, or the Outlook that was made last month. Currently, I am using switch functions to pick a measure that selects values based on the version. It looks like the below, including the output table

 

Actual/Outlook measure=

 

  CALCULATE (

        SUM ( Financials[Value] ),

        OR (

            Financials[Actual/Outlook] = "Actual",

            Financials[Actual/Outlook] = "Outlook"

        ))

 

Comparison Selection =

SWITCH (

    TRUE (),

    'Metric Selection Comparison'[Metric Select Comparison] = "Last Year", 'Metric Selection Comparison'[Comparison_Lastyear],

    'Metric Selection Comparison'[Metric Select Comparison] = "Budget", 'Metric Selection Comparison'[Comparison_Budget],

    'Metric Selection Comparison'[Metric Select Comparison] = "Outlook LM", 'Metric Selection Comparison'[Comparison_OutlookLM],

    0

)

 

With budget being: CALCULATE ( SUM ( Financials[Value] ), Financials[Version] = "Budget" )

 

 

Output:

 

 

 

 

This way works, but it reduces performance a bit. However, I was told about calculation groups and saw the potential for boosting my model performance. So I created a calculation group for versions that considers my three scenarios; Budget, Last Year, and Outlook LM. It works perfectly when I use the calculation group for the comparison measure in the slicer. However, my actual measure doesn’t work anymore, and no matter what I do, it returns the exact same value as my comparison measure. Below are my two measures.

 

Acutal:    CALCULATE (

        SUM ( Financials[Value] ),

        all(Financials),

        OR (

            Financials[Actual/Outlook] = "Actual",

            Financials[Actual/Outlook] = "Outlook"

        )

     )

 

Comparison tester =

sum(Financials[Value])

 

 

 

This makes me wonder if two measures can co-exist with the calculations group and, if so, how to manage it.

 

 

Thank you in advance

2 Replies