How to create measure table in Power BI

이미지
   # Power BI - How to create measure table How to Create a Measures Table We're gonna dive into how to create a Measures Table in Power BI. It's super helpful for managing all your measures efficiently. A Measures Table is a best practice that seriously boosts your report's readability and makes it way easier to maintain . 1.  Why Create a Measures Table? Here's the problem: As you build out your Power BI model, all your measures (the stuff you calculate with DAX) tend to get spread out among a bunch of different tables. What happens then? Well, it takes forever to find the right measure in the Fields pane when you're building a report, and the whole model becomes a nightmare to manage later on. The Measures Table is the fix! It's basically a special container that holds only your measures. This keeps them clean, organized, and visible right at the top of your field list, easy to spot with the little calculator icon. 2.  The Core Steps: How to Create...

Power BI DAX – SWITCH 함수로 영어 카테고리를 한글로 바꾸기

#Power BI DAX – Converting English Categories to Korean Using the SWITCH Function


Power BI에서 데이터 시각화를 하다 보면 영문으로 된 카테고리명을 한글로 변환해서 보여주고 싶을 때가 많아요.
예를 들어,

  • "shirts"는 "상의"

  • "pants"는 "하의"

  • "shoes"는 "신발"

  • 이렇게 깔끔하게 한글로 보여주고 싶을 때 SWITCH 함수를 활용하면 정말 편리하답니다.


1. SWITCH 함수란?

간단히 말해, 조건별로 다른 값을 반환하는 함수예요.
엑셀의 IF, IF… 대신 SWITCH 하나로 여러 조건을 처리할 수 있어요.


2. 기본 문법


SWITCH(<expression>, <value1>, <result1>, <value2>, <result2>, ..., [<else>])
  • expression: 비교할 값

  • value1, value2…: 조건 값

  • result1, result2…: 해당 조건일 때 반환할 값

  • [else]: 아무 조건에도 해당하지 않을 때 반환할 기본값 (선택사항)


3. 예제: 영어 제품명을 한글로 바꾸기

제품명이 T-Shirts , Skirt, Jacket, Pants 로 되어있다고 가정할게요.

DAX로 새 열을 만들어 한글로 바꾸려면 이렇게 작성하면 됩니다.


Product(K) = SWITCH(  [Product], "T-Shirts", "티셔츠"
    ,  "Skirt", "치마"
    ,  "Jacket", "자켓"
    ,  "Pants", "바지"
    , "기타"
)


DAX funtion_change from english name to korean name by product level


제품명 컬럼의 값이 shirts면 티셔츠, pants면 바지, 이렇게 치마, 자켓... 

그 외는 “기타”로 표시됩니다.


4. 결과 미리보기

Result_created Product(K) in d_Product table





팁: SWITCH VS IF

조건 개수추천 함수
2~3개 이하         IF 사용 가능
4개 이상        SWITCH가 훨씬 깔끔하고 가독성 좋음 

추가 응용 – 숫자 범위에 따라 구간 설정하고 싶다면?


Sales Grade = SWITCH( TRUE(), [매출] > 1000000, "최우수", [매출] > 500000, "우수", [매출] > 100000, "보통", "미달" )

TRUE()를 써서 조건 비교도 가능합니다!



5. 마무리

 SWITCH 함수는 다중 조건 처리가 필요할 때 매우 유용

 Power BI에서 텍스트 변환, 범주 구분 등에 자주 사용됨


혹시 아직 어려우신가요? DAX를 처음 접하셨다면 CALCULATE, IF, SWITCH 부터 익히는 걸 추천 드립니다.


앞시간에 배운 IF 함수는 하단 링크를 참조하세요.



<이 블로그 내 다른 게시글>




인기글

Power BI Desktop 무료버전 설치방법 (2025년 9월 최신 가이드)

Power BI DAX 기초부터! 데이터 분석의 첫걸음