Forum Discussion
Nested Calculation item not working
Thank You for responding, I tried both ways did'nt work
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.
- han_rj1 year agoHelper IV
Anonymous , Thank You for responding
This is the sample data
Calculation Items used
Last_Year = CALCULATE(SELECTEDMEASURE(),'Table'[Last_Year_Ind] = "Y")This_Year = CALCULATE(SELECTEDMEASURE(),'Table'[This_Year_Ind] = "Y")YOY = CALCULATE(SELECTEDMEASURE(),'Table'[This_Year_Ind] = "Y") -CALCULATE(SELECTEDMEASURE(),'Table'[Last_Year_Ind] = "Y")Current ResultsExpected
I want variance for the current year only
- Anonymous1 year agoNot applicable
Hi han_rj
Please try this:
First of all, Create a measure:
Measure = SUM('Table'[Sales])Then add a calculation group:
Last_Year = CALCULATE(SELECTEDMEASURE(),'Table'[Last_Year_Ind] = "Y")This_Year = CALCULATE(SELECTEDMEASURE(),'Table'[This_Year_Ind] = "Y")YOY = CALCULATE ( SELECTEDMEASURE (), 'Table'[This_Year_Ind] = "Y" ) - CALCULATE ( SELECTEDMEASURE (), 'Table'[Last_Year_Ind] = "Y" )Finally, create a Matrix and the result is as follow:
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.- han_rj1 year agoHelper IV
Thank You Anonymous for responding the format I am looking for is like this
CY, TY label and the Year.
If we exclude the Year in the column we get the correct results but when we add Year to the column the variance is off like this