我有一个PowerBI每月的数据,如下所示:
ID Month FY
A 1 TY
A 2 TY
A 1 LY
B 1 TY
B 2 TY
如何在每个FY的新列中检查ID?
ID Month FY Marker
A 1 TY y
A 2 TY y
A 1 LY y
B 1 TY n
B 2 TY n
我尝试使用摘要,但是我不知道如何继续:
New column= summarize(data, ID, FY, "Count", distinctcount(ID))
答案 0 :(得分:1)
尝试以下措施-
Marker =
VAR current_row_id = your_table_name[ID]
VAR fy_count_total =
CALCULATE(
DISTINCTCOUNT(your_table_name[FY]),
ALL(your_table_name)
)
VAR fy_count_for_id =
CALCULATE(
DISTINCTCOUNT(your_table_name[FY]),
FILTER(
ALL(your_table_name),
your_table_name[ID] = current_row_id
)
)
RETURN
IF(
fy_count_total = fy_count_for_id ,
"Y",
"N"
)