Forum Discussion
Dynamic measure calculation for hierarchy data
- 7 years ago
Hi Saurabh,
Please download the demo from the attachment then you can check the details.
1. Establish proper relationships.
2. Create three measures.
Not_Started Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Not_Started] ), SUM ( Table2[Not_Started] ) )
Inprogress Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Inprogress] ), SUM ( Table2[Inprogress] ) )
Completed Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Completed] ), SUM ( Table2[Completed] ) )
Best Regards,
Dale - 7 years ago
Hi Saurabh,
Did it have the similar structure for the third level like below?
Level1 Name Level2 Name Level3 Name
If so, please try this formula. If not, please provide a sample. The main idea is recognizing the lower level first.
Completed Sum = IF ( ISFILTERED ( Table2_1[Level1 Name] ), SUM ( Table2_1[Completed] ), IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Completed] ), SUM ( Table2[Completed] ) ) )
Best Regards,
Dale
Hi Saurabh,
Please download the demo from the attachment then you can check the details.
1. Establish proper relationships.
2. Create three measures.
Not_Started Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Not_Started] ), SUM ( Table2[Not_Started] ) )
Inprogress Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Inprogress] ), SUM ( Table2[Inprogress] ) )
Completed Sum = IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Completed] ), SUM ( Table2[Completed] ) )
Best Regards,
Dale
- saurabh_kedia_7 years agoMicrosoft Employee
Hi Jiascu,
Thanks a lot for your response.
It is working well with two levels of hierarchy but I actually needed the same for three levels of hierarchy.
I thought the solution can simply be implemented on to three levels although this was not the case.
Assuming there is one more table in the hierarchy i.e. above Table 2 namely Table2_1, how can the same be implmented.
I tried to make a calculation as :
Completed Sum =
IF(ISFILTERED(Table2_1[Level1 Name])=FALSE, SUM(Table2_1[Completed]),IF(ISFILTERED(Table1)=FALSE,SUM(Table1[Completed]),SUM(Table2[Completed]))
Kindly assist on the same, I have searched through some other articles but this is apprently not so straight forward I guess.
Regards,
Saurabh
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Saurabh,
Did it have the similar structure for the third level like below?
Level1 Name Level2 Name Level3 Name
If so, please try this formula. If not, please provide a sample. The main idea is recognizing the lower level first.
Completed Sum = IF ( ISFILTERED ( Table2_1[Level1 Name] ), SUM ( Table2_1[Completed] ), IF ( ISFILTERED ( Table1[Level2 Name] ), SUM ( Table3[Completed] ), SUM ( Table2[Completed] ) ) )
Best Regards,
Dale