LeCoda
LeCoda

Reputation: 1016

DAX Query - Filtering out values from a table in powerbi

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!

Upvotes: 0

Views: 392

Answers (1)

mkRabbani
mkRabbani

Reputation: 16908

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]
    )
)

Upvotes: 1

Related Questions