Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone and apologies if this has been answered before. I cannot find any answer.
This is my scenario:
Plans table contains the following important columns for the scenario: [Plan] (the name of the plan), [PlanType] (the type of plan, which can be Portfolio, Program, Project, Epic, or Standalone Project), [Id] (the unique identifier of the plan), [Parent] (the identifier of the parent plan), [Plan Path] (a calculated column using the PATH function to show the access path of a plan in the parent/child relationship), [Plan Level] (the level of the plan in the path using the PATHLENGTH function), [Level 1] (a calculated column using the PATHITEM function corresponding to the top level of the plan hierarchy), [Level 2] (a calculated column using the PATHITEM function corresponding to the Portfolio level), [Level 3] (a calculated column using the PATHITEM function corresponding to the Program or Standalone Project level), [Level 4] (a calculated column using the PATHITEM function corresponding to the Project or Epic level).
What I need to do is to be able to select a value from that table, and then calculate the child plans when selecting a Portfolio or Program.
I have tried different calculated tables.
This one gives me an empty table:
Child Plans =
VAR _selectdplan = SELECTEDVALUE(Plans[Id])
RETURN
FILTER(
ALL(Plans),
PATHCONTAINS(Plans[Plan Path],_selectdplan)
)
This one gives me the parent instead of children:
ChildrenPlans = VAR plan = SELECTEDVALUE(Plans[Id]) RETURN CALCULATETABLE( Plans, Plans[Parent] = plan )
If I hardcode one value to test like this, it gives me the rows I need:
ChildrenPlans =
VAR plan = SELECTEDVALUE(Plans[Id])
RETURN
CALCULATETABLE( Plans, Plans[Parent] = "f8e991a3-74b9-4d43-b8c8-80dbaee72ea0" )
I'm obviously doing something wrong but can't figure out why.
Any help is appreciated.
Solved! Go to Solution.
"What I need to do is to be able to select a value from that table, and then calculate the child plans when selecting a Portfolio or Program." - How are you selecting these values? If these values are from slicers or visuals, you're on the wrong track because you're creating tables with FILTER and CALCULATETABLE (These are created at refresh time and don't respond to slicers or visuals)
Hi @RENEALVAREZM ,
Here I agree with HotChilli. According to your statement, I think you are creating a calculated table.
As far as I know, the calculated table or calculated column will not be dynamic based on slicer.
Here you use max function in your calculated table code, so it will always return the value with max id.
I suggest you to try measure. Measure will return aggregation value which could be dynamic based on slicer.
For reference: Calculated Columns and Measures in DAX - SQLBI
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
"What I need to do is to be able to select a value from that table, and then calculate the child plans when selecting a Portfolio or Program." - How are you selecting these values? If these values are from slicers or visuals, you're on the wrong track because you're creating tables with FILTER and CALCULATETABLE (These are created at refresh time and don't respond to slicers or visuals)
Thanks for your prompt response. I'm applying drill-through. This should update the results of DAX expressions correct?
I'm testing with a direct filter in the page, and even if I have the correct Id for the parent, the ChildrenPlans table is not being correctly filtered and I have no idea why.
Hi @RENEALVAREZM ,
Here I agree with HotChilli. According to your statement, I think you are creating a calculated table.
As far as I know, the calculated table or calculated column will not be dynamic based on slicer.
Here you use max function in your calculated table code, so it will always return the value with max id.
I suggest you to try measure. Measure will return aggregation value which could be dynamic based on slicer.
For reference: Calculated Columns and Measures in DAX - SQLBI
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |