cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
a10703
Frequent Visitor

Countrows with Column A string and B number

Hi guys,

I need help in one measure.

 

I have the format Column A = String and the Collumn B = Number

I need to count the number of rows that meet these requirments:

Count if the value on column A is = "NACIONAL" and if the value on column b ="0" or "1" .

 

But my measure appears one error "MdxScript(Model) (121, 167) Calculation error in measure "Table1"[feedbackmeasure]: Function 'CONTAINSROW' does not support comparison values ​​of type Text with values ​​of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

 

My measure:

feedbackmeasure= calculate(counta('Table1'[COLUMN A]),Filter(Table1,Table1[COLUMN A]="NACIONAL" && Table1[COLUMN B] IN {"0","1"} ))

 

Datatable:

COLUMN ACOLUMN B
NACIONAL1
INTERNACIONAL3
NACIONAL4
NACIONAL4
NACIONAL1
INTERNACIONAL3
INTERNACIONAL3
NACIONAL0
NACIONAL1
NACIONAL0
INTERNACIONAL3
INTERNACIONAL3

 

Some solution for this?

Thanks

1 ACCEPTED SOLUTION
AntonioM
Super User
Super User

"0" and "1" are both Text, because you've enclosed them in quotes. 

 

Try 

Table1[COLUMN B] IN {0,1}

and see if that works

View solution in original post

1 REPLY 1
AntonioM
Super User
Super User

"0" and "1" are both Text, because you've enclosed them in quotes. 

 

Try 

Table1[COLUMN B] IN {0,1}

and see if that works

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Top Solution Authors