表格模型-按列排序:属性值无效多个不同的值

时间:2019-09-04 14:27:24

标签: powerbi ssas-tabular

我有以下日期表:

enter image description here

当我使用MonthYear Past列并想要进行排序时,排序顺序是按字母顺序而不是按字母顺序排列。当我想更改为SSAS表格模型中的“排序顺序”时,我选择了datekey或date,但出现以下错误:

Property value is not valid 
Cannot sort MonthYear Past by Date because at least one value in 
MonthYear Past has multiple distinct values in Date. For example,
you can sort [City] by [Region] because there is only one region for each city,
but you cannot sort [Region] by [City] because there are multiple cities for each region.

如何对本专栏进行长期排序?

1 个答案:

答案 0 :(得分:1)

要解决此问题:

因为过去与多个值链接,所以我创建了一个新的计算列,当该列过去时该值为1,否则该值为YearMonth。 &然后在新的计算列上排序