本文介绍了DAX查询-从Powerbi中的表中过滤出值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DAX在powerbi中进行一些数据分析.非常习惯Python,但DAX却使它迷失了.

我要尝试的是从度量中筛选出值.

目前的措施是这样的

  Measure.Controllable =计算(计数行(table_adj_spec_uno),table_adj_spec_uno [column_uno] =变量1",用户名('table_adj_spec_uno'[IncidentDate],'Table.Date'[DateOnly])) 

我需要从此表和列中滤除该值,

  table_adj_spec_uno [column_two]<>空白的() 

  table_adj_spec_uno [column_two]<>"Acceptance_mwap"; 

如何计算仅包含这些值的行?

此外,如果我想返回第二列作为度量,而没有上面的值,我在寻找什么DAX查询?

感谢任何帮助.

谢谢!

解决方案

尝试以下更改-

  Measure.Controllable =计算(计数行(table_adj_spec_uno),table_adj_spec_uno [column_uno] =变量1",table_adj_spec_uno [column_two]<>空白的(),table_adj_spec_uno [column_two]<>"Acceptance_mwap",用户名('table_adj_spec_uno'[IncidentDate],'Table.Date'[DateOnly])) 

OR

  Measure.Controllable =计算(计数行(table_adj_spec_uno),KEEPFILTERS(table_adj_spec_uno [column_uno] =变量1"),KEEPFILTERS(table_adj_spec_uno [column_two]<> BLANK()),KEEPFILTERS(table_adj_spec_uno [column_two]<>"Acceptance_mwap"),用户名('table_adj_spec_uno'[IncidentDate],'Table.Date'[DateOnly])) 

I'm using DAX to do some data analysis in powerbi. Very used to Python, bit lost with DAX.

What I'm trying to do is filter out values from a measure.

Currently the measure is like this,

Measure.Controllable = 
CALCULATE(
    countrows(table_adj_spec_uno), 
    table_adj_spec_uno[column_uno] = "variable 1",
    USERELATIONSHIP(
        'table_adj_spec_uno'[IncidentDate],
        'Table.Date'[DateOnly]
    )
)

I need to filter out this value from this table and column,

table_adj_spec_uno[column_two] <> BLANK()

and

table_adj_spec_uno[column_two] <> "Acceptance_mwap"

How do I count the rows, that include only the values with these things?

Also, if i want to return column two as a measure, without the values above, what DAX query am I looking for?

Appreciate any help.

Thanks!

解决方案

Try with this below changes-

Measure.Controllable = 
CALCULATE(
    countrows(table_adj_spec_uno),
    table_adj_spec_uno[column_uno] = "variable 1",
    table_adj_spec_uno[column_two] <> BLANK(),
    table_adj_spec_uno[column_two] <> "Acceptance_mwap",    
    USERELATIONSHIP(
        'table_adj_spec_uno'[IncidentDate],
        'Table.Date'[DateOnly]
    )
)

OR

Measure.Controllable = 
CALCULATE(
    countrows(table_adj_spec_uno),
    KEEPFILTERS(table_adj_spec_uno[column_uno] = "variable 1"),
    KEEPFILTERS(table_adj_spec_uno[column_two] <> BLANK()),
    KEEPFILTERS(table_adj_spec_uno[column_two] <> "Acceptance_mwap"),    
    USERELATIONSHIP(
        'table_adj_spec_uno'[IncidentDate],
        'Table.Date'[DateOnly]
    )
)

这篇关于DAX查询-从Powerbi中的表中过滤出值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:34