๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Power BI/DAX

[Power BI] DAX - SUMMARIZECOLUMNS

๋ฐ˜์‘ํ˜•

 

 

 


SUMM_TABLE ์ด๋ผ๋Š” ์š”์•ฝ ํ…Œ์ด๋ธ” ๋งŒ๋“ค๊ธฐ
TABLE์—์„œ YEAR, PRODUCT, START, END ๊ทธ๋ฃนํ™”ํ•˜๊ณ  ๊ฐฏ์ˆ˜์—ด CNT๋ฅผ ์ถ”๊ฐ€ํ•œ ํ…Œ์ด๋ธ”์„ SUMMARIZECOLUMNS๋กœ ๋งŒ๋“ฌ
-> SUMMARIZECOLUMNS(TABLE[YEAR], TABLE[PRODUCT], TABLE[START], TABLE[END], "CNT", COUNT(TABLE[START])

ํ•ด๋‹น ํ…Œ์ด๋ธ”์—์„œ CNT๊ฐ€ 1 ์ด์ƒ์ธ ํ–‰ ๋“ค๋งŒ ์ถ”์ถœํ•˜๊ณ  ์‹ถ์Œ

SUMM_TABLE = SUMMARIZE(
FILTER(SUMMARIZECOLUMNS(TABLE[YEAR], TABLE[PRODUCT], TABLE[START], TABLE[END], "CNT", COUNT(TABLE[START])), [CNT] > 1),
[Year], [PRODUCT], [START], [END], [CNT]
)

 

 

 

 

SUMMARIZECOLUMNS ( 
    'Sales Territory'[Category], 'Customer' [Education], 
    FILTER('Customer', 'Customer'[First Name] = "Alicia"),
    "First", FIRSTNOBLANK('Customer'[First Name], "")
)

 

 

FIRST_DATE = SUMMARIZECOLUMNS(Report[NM],
                            FILTER(Report, Report[DATE_TIME] <= (DATE(2022,1,1) + TIME(12,0,0)) && Report[DATE_TIME] >= (DATE(2021,1,1) + TIME(12,0,0)) && Report[EVENT]<>"First"),
                            "Date", FIRSTNONBLANK(Report[DATE_TIME],""))

 

 

  • D_TIME ์ด 2021 ์ด์ „ ๋ฐ์ดํ„ฐ ์ค‘ ๋งˆ์ง€๋ง‰ D_TIME
  • ์—ด : NM, LAST
ํ…Œ์ด๋ธ” = SUMMARIZECOLUMNS(TABLE[NM], FILTER(TABLE, YEAR(TABLE[D_TIME]) < 2021), "LAST", MAX(TABLE[D_TIME]))

 

 

docs.microsoft.com/ko-kr/dax/summarizecolumns-function-dax

 

SUMMARIZECOLUMNS ํ•จ์ˆ˜(DAX) - DAX

๋‹ค์Œ์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด์„ธ์š”. SUMMARIZECOLUMNS

docs.microsoft.com

 

 

 

๋ฐ˜์‘ํ˜•

'Power BI > DAX' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Power BI] DAX - GENERATE  (0) 2022.05.03
[Power BI] DAX - SUMMARIZE  (0) 2021.02.23
[Power BI] DAX - CALCULATE  (0) 2021.02.23
[Power BI] DAX - Dynamic Index  (0) 2020.09.01
[Power BI] DAX - The GENERATESERIES function  (0) 2019.08.07