Forum Discussion
Add String value to correct hierarchy levels with ISINSCOPE
- 4 years ago
Hi MaxSchrijen23 ,
I have done the following measure:
Leader Value = LOOKUPVALUE ( ProjectData[Leader], ProjectData[SubSubProjectId], SWITCH ( TRUE (), ISINSCOPE ( ProjectHierarchy[SubSubProjects] ), SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ), ISINSCOPE ( ProjectHierarchy[SubProject] ), CALCULATE ( SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ), ProjectHierarchy[IsTotal] = 1 && ProjectHierarchy[SubProject] = SELECTEDVALUE ( ProjectHierarchy[subProject] ) ), ISINSCOPE ( ProjectHierarchy[Project] ), CALCULATE ( SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ), ProjectHierarchy[IsTotal] = 2 && ProjectHierarchy[Project] = SELECTEDVALUE ( ProjectHierarchy[Project] ) ) ) )Result is below:
Now you can make some tweaks to hide the values that are blank but don't believe it's the best option.
In this case you need to use a Parent Child hierarchy. Using this post I have made some changes to your model:
Result is below:
This passes to having your projects table in the following format:
I have all the formulas and results in the table ProjectHierarchy (2). Please tell me what you think.
See attach Excel file and PBIX file.
Hi MaxSchrijen23 ,
I have done the following measure:
Leader Value =
LOOKUPVALUE (
ProjectData[Leader],
ProjectData[SubSubProjectId],
SWITCH (
TRUE (),
ISINSCOPE ( ProjectHierarchy[SubSubProjects] ), SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ),
ISINSCOPE ( ProjectHierarchy[SubProject] ),
CALCULATE (
SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ),
ProjectHierarchy[IsTotal] = 1
&& ProjectHierarchy[SubProject] = SELECTEDVALUE ( ProjectHierarchy[subProject] )
),
ISINSCOPE ( ProjectHierarchy[Project] ),
CALCULATE (
SELECTEDVALUE ( ProjectHierarchy[SubSubProjectId] ),
ProjectHierarchy[IsTotal] = 2
&& ProjectHierarchy[Project] = SELECTEDVALUE ( ProjectHierarchy[Project] )
)
)
)
Result is below:
Now you can make some tweaks to hide the values that are blank but don't believe it's the best option.
In this case you need to use a Parent Child hierarchy. Using this post I have made some changes to your model:
Result is below:
This passes to having your projects table in the following format:
I have all the formulas and results in the table ProjectHierarchy (2). Please tell me what you think.
See attach Excel file and PBIX file.
Thanks a lot Felix!! This is exactly what I needed!