cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Juampe Regular Visitor
Regular Visitor

Add New Column (flag)

Hi world!

I came from the green side (Qlik) so I´ve found some problemns developing some "script" tasks that for sure you will help me

It´s really easy.

I want to add a new column (flag column) with values 0 and 1 when the following isntructions:

 

****Column ID is NULL  AND Column TYPE is different than the value "house"****

 

ID,TYPE,FLAG,
123house0
21232garage0
4235store0
24house0
 garage1
 store1
 house0
 garage1
 store1

 

In Qlik should be something like if(isnull(ID) and TYPE <>"house",1,0)  


But I am a beginner in DAX model so I need some help

1 ACCEPTED SOLUTION

Accepted Solutions
themistoklis New Contributor
New Contributor

Re: Add New Column (flag)

@Juampe

 

Try this formula

 

Column = IF(LEN(Table[COLUMN_D])=0 && Table[TYPE] <> "house",1,0)

 

OR

 

Column = IF(Table[COLUMN_D]=BLANK() && Table[TYPE] <> "house",1,0)

 

View solution in original post

5 REPLIES 5
themistoklis New Contributor
New Contributor

Re: Add New Column (flag)

@Juampe

 

Try this formula

 

Column = IF(LEN(Table[COLUMN_D])=0 && Table[TYPE] <> "house",1,0)

 

OR

 

Column = IF(Table[COLUMN_D]=BLANK() && Table[TYPE] <> "house",1,0)

 

View solution in original post

Omega Established Member
Established Member

Re: Add New Column (flag)

Try 

 

Flag = IF(ISBLANK(Table2[ID]) && Table2[TYPE,] <> "House",1,0)
Juampe Regular Visitor
Regular Visitor

Re: Add New Column (flag)

There is a problem with the formula the PBI says the following " Token RoghtParen expected"  and select the first coma "," --> 

,1,0)

 any idea?

Highlighted
themistoklis New Contributor
New Contributor

Re: Add New Column (flag)

@Juampe

 

Where did you put the formula? It seems that you are creating a column using Power Query.

This is a DAX formula.

 

Also based on regional settings the comma can be replaced with semicolon ' ; '

Juampe Regular Visitor
Regular Visitor

Re: Add New Column (flag)

Ok I got it!!! I was trying to edit the query, I was in the wrong section.

Thanks all for the responses,  BTW I needed ";" instead of "," 

Smiley Wink

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 491 members 4,243 guests
Please welcome our newest community members: