[DAX 함수] Path 함수

2019. 7. 16. 11:00엑셀/파워피벗 공부

728x90
반응형

DAX 함수에는 모-자 관계를 이용하여 사용이 가능한 PATH 함수가 있다. 

From ~ To , 부모 ~ 자식 관계를 이용하여 경로를 뽑아내고 이를 이용하여 순위나 서열을 계산 할 수 있다. 

관련 내용은 아래 링크를 참조 

https://docs.microsoft.com/en-us/dax/understanding-functions-for-parent-child-hierarchies-in-dax

 

Understanding functions for Parent-Child Hierarchies in DAX - DAX

Understanding functions for parent-child hierarchies in DAX In this article --> DAX provides five functions to help users manage data that is presented as a parent-child hierarchy in their models. With this functions a user can obtain the entire lineage of

docs.microsoft.com

일반적인 업무 활용 포인트는

  • 계산 순위를 산정
  • 모자 관계의 서열 계산
  • 경로를 손쉽게 시각화

일단 이정도로 예상된다.

데이터 형태의 분석에는 조금 적합치 않다. 왜냐하면 첫번째 시작값을 알아야 하기 때문이다. 
첫번째가 지정이 되지 않으면 에러가 발생한다. 

하지만 계층화된 모양을 표현할 수 있다는 것만으로도 활용가치는 충분하다 생각한다. 

간단한 사용 예시를 파일로 첨부한다. 

Path Function.xlsx
0.12MB

1) 첨부된 파일을 열어 power pivot tab 의 데이터모델 관리를 클릭하여 데이터 모델창을 실행

2) path 함수로 전체 경로를 필드로 추가 

3) Pathlength  함수로 경로의 길이를 계산 -> 이 경로의 길이는 "to(부모)"의 순위가 된다. 

728x90
반응형