如何在 power bi 中使用度量作为轴 [英] How to use a measure as an axis in power bi

查看:40
本文介绍了如何在 power bi 中使用度量作为轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,我称之为cuartil",我想将其用作轴.如果我把它放在一个表格中,它会显示如下:

I have a query that I call "cuartil" which I want to work as an axis. If I put it in a table it would show like this:

那么此度量可能会根据所制作的区域过滤器而有所不同,例如在此图像中:

then this measure may vary according to the region filter that is made, as for example in this image:

但我想将它显示在图表中,我想在其中使用度量作为轴,但是 power bi 不允许我这样使用它

but I want to show it in a graph, in which I would like to use the measure as an axis, but the power bi does not allow me to use it as such

有没有办法把度量作为轴?

Will there be any way to put a measure as an axis?

要获得cuartil"度量,首先计算 UniqueRank:

To obtain the "cuartil" measure, first calculate the UniqueRank:

UniqueRank = 
RANKX (
  tabla_ranking;
  FORMAT ( tabla_ranking[nro_trabajos]; "0000" ) & tabla_ranking[region] & 
tabla_ranking[site]
)

然后我计算度量排名2:

then I calculate the measure ranking2:

ranking2 = 
RANKX (
   ALLSELECTED ( tabla_ranking );
   tabla_ranking[UniqueRank];
   MAX ( tabla_ranking[UniqueRank] )
)

最后计算度量cuartil"

and finally calculate the measure "cuartil"

  cuartil = IF(tabla_ranking[ranking2]<= 
    [total_registros]*0.25;"1P";IF(tabla_ranking[ranking2]<= 
    [total_registros]*0.5;"2P";IF(tabla_ranking[ranking2]<= 
    [total_registros]*0.75;"3P";"4P")))

推荐答案

您不能对轴使用度量.但是,如果 cuartil 不依赖于切片器或任何动态过滤,那么您可以使用度量创建计算列并将计算列用于您的轴.

You can't use a measure for an axis. However, if cuartil is not dependent on a slicer or any dynamic filtering, then you can create a calculated column using the measure and use the calculated column for your axis.

要在轴上使用 cuartil,请创建一个带有列的新表 Axis:

To use cuartil on an axis, create a new table Axis with the column:

cuartil
----
1P
2P
3P
4P

然后您可以编写用于图表的度量.例如,

Then you can write measures to use for your graph. For example,

numero trabajos = 
CALCULATE (
    SUM ( tabla_ranking[nro_trabajos] ),
    FILTER ( tabla_ranking, [cuartil] IN VALUES ( Axis[cuartil] ) )
)

这篇关于如何在 power bi 中使用度量作为轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆