下面的排名窗口功能不起作用。排名只给我一个。我正在尝试对“季度变化百分比”与“日历”[年份]和“日历”[季度]进行排名:
EVALUATE
SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
"% Change Quarter", [% Change Quarter],
"RNK", rank(
DENSE,
SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
"% Change Quarter", [% Change Quarter]
),
ORDERBY([% Change Quarter], DESC),
PARTITIONBY('Calendar'[Year])
)
)
输出如下:
|Calendar[Year]|Calendar[Quarter]| [% Change Quarter]|[RNK]
-----------------------------------------------------------
|2023 | Q2 |0.07 |1
|2023 | Q3 |-0.11 |1
|2023 | Q4 |0.57 |1
|2024 | Q1 |0.69 |1
|2024 | Q2 |-0.12 |1
|2024 | Q3 |0.01 |1
我错过了什么,我的年度和季度过滤器上下文是否有问题?它是否需要一个“全部”过滤功能,因为我尝试过使用summarycolumn,但它不起作用。
以下是PBIX文件: https://1drv.ms/u/c/1e7368b2a4fe3faa/EdliZDH7XtlItZYYIRZasBABiGHzsp-whGV-q1mqOW0KiQ?e=9bnnii
这符合你的要求吗?
EVALUATE
SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
"% Change Quarter", [% Change Quarter],
"RNK", RANK(
DENSE,
CALCULATETABLE(SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
"% Change Quarter", [% Change Quarter]
), REMOVEFILTERS('Calendar'[Year],'Calendar'[Quarter])),
ORDERBY(
[% Change Quarter],
DESC
),
PARTITIONBY('Calendar'[Year])
)
)