基于百分位数的 Power BI 条件格式
Power BI conditional formatting based on percentiles
Power BI 中有没有一种方法可以应用基于百分位数的条件格式?如果数据包含离群值,这是非常有用的功能。
在Excel我已经习惯了很容易做出来:
我知道我可以根据可以作为衡量标准的任何 字段 进行格式化。
我想构建一个 DAX 指标:
Sales_per_category_percentile = PERCENTILE.EXC(DISTINCT(table[Category]) , [Sales]))
但它不接受 DISTINCT(table[Category])
作为 PERCENTILE.EXC
函数的第一个参数。
您应该能够对矩阵进行条件格式化。
刚刚在 power-bi-desktop-july-2019
发布
In addition to adding a new type of conditional formatting, we’ve
extended in general our Rules form of conditional formatting to
support Percent, which allows you to apply formatting on a dynamic
range of data, instead of having to specify an absolute number that
can become absolute as data refreshes. We also added the Reverse
button from the Icon dialog for colors as well, so it’s easier to
quick swap the direction of your rules.
让我们看看PERCENTILE.EXC定义。
PERCENTILE.EXC(<column>, <k>)
Term Definition
column A column containing the values that define relative standing.
k The percentile value in the range 0..1, exclusive.
编辑:(你是正确的值不起作用)
您必须提供一列。并在 0 和 1 之间选择你的 K,比如 0.5
Sales_per_category_percentile = PERCENTILE.EXC('Fact'[Salesamount],0.5)
并在矩阵中使用它,例如在行中使用 table[类别]。
EDIT2:对于合并和分组,请查看:
Grouping and Binning in Power BI
Power BI 中有没有一种方法可以应用基于百分位数的条件格式?如果数据包含离群值,这是非常有用的功能。
在Excel我已经习惯了很容易做出来:
我知道我可以根据可以作为衡量标准的任何 字段 进行格式化。
我想构建一个 DAX 指标:
Sales_per_category_percentile = PERCENTILE.EXC(DISTINCT(table[Category]) , [Sales]))
但它不接受 DISTINCT(table[Category])
作为 PERCENTILE.EXC
函数的第一个参数。
您应该能够对矩阵进行条件格式化。
刚刚在 power-bi-desktop-july-2019
发布In addition to adding a new type of conditional formatting, we’ve extended in general our Rules form of conditional formatting to support Percent, which allows you to apply formatting on a dynamic range of data, instead of having to specify an absolute number that can become absolute as data refreshes. We also added the Reverse button from the Icon dialog for colors as well, so it’s easier to quick swap the direction of your rules.
让我们看看PERCENTILE.EXC定义。
PERCENTILE.EXC(<column>, <k>)
Term Definition
column A column containing the values that define relative standing.
k The percentile value in the range 0..1, exclusive.
编辑:(你是正确的值不起作用) 您必须提供一列。并在 0 和 1 之间选择你的 K,比如 0.5
Sales_per_category_percentile = PERCENTILE.EXC('Fact'[Salesamount],0.5)
并在矩阵中使用它,例如在行中使用 table[类别]。
EDIT2:对于合并和分组,请查看: Grouping and Binning in Power BI