Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

PATH function with CALCULATE

Hi,

 

I have a hierarchy table with column "ID" and "Parent ID". In the same table, I have this hierarchy for each week, so depending the week, the "Parent ID" may changes.

 

IDParent IDWeekPath
1213|2|1
1222|1
1 31
2313|2
2 22
2 32
3 13
3 23
3 33

 

So the Path depends of the week.

I tried this :

 

Path = 
VAR Monitored_Week = 'Table'[Week]
RETURN

CALCULATE(
    PATH('Table'[ID],'Table'[Parent ID])
    ,FILTER('Table' ,'Table'[Week] = Monitored_Week))

 

 

But I have this issue :

Each value in 'Table'[ID] must have the same value in 'Table'[Parent ID]. The value '1' has multiple values.

 

I do not understand because inside the CALCULATE function, the Table is filtered only for the row with the same Week value. 

3 REPLIES 3
Anonymous
Not applicable

Thank @Anonymous 

I understand the fact that the <ID_columnName> contains the unique identifier of the row in the table. That is why I want use the CALCULATE function in order to "Evaluates an expression in a modified filter context." 

Reference : CALCULATE function(DAX)

Anonymous
Not applicable

Hi @Anonymous ,

 

Could you tell me your logic in the red line part? I think the PATH function may not be applicable here.

38.png

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

Hi @Anonymous ,

 

 

PATH(<ID_columnName>, <parent_columnName>)  

 

<ID_columnName> contains the unique identifier of the row in the table. The ID column cannot have duplicate values.

 

 

Path = PATH([ID],[Parent ID])

 

4.png

 

Reference: PATH function(DAX)

 

 

 

Best Regards,

Stephen Tao

 

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

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.