Forum Discussion

han_rj's avatar
han_rj
Helper IV
1 year ago

Nested Calculation item not working

I have created a calculation item for This Year and Prior Year and wanted to calculate Variance for it.

But the varaince calculation item is not working 

Variance = CALCULATE(SELECTEDMEASURE(),Time_Period[Time_Period_Grp] = "TY") -  CALCULATE(SELECTEDMEASURE(),Time_Period[Time_Period_Grp] = "LY")

 

 

7 Replies

  • A calculation group is only called once per measure, so you cannot nest them like this. You would either need to have the variance in a separate calculation group or replicate the time intelligence logic in the TY & LY calculation items.

    • han_rj's avatar
      han_rj
      Helper IV

      Thank You for responding, I tried both ways did'nt work

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi han_rj 

         

        Could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

        How to provide sample data in the Power BI Forum

        How to Get Your Question Answered Quickly

        And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

        How to upload PBI in Community

         

        Best Regards

        Zhengdong Xu
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.