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

Create Non Numeric (String) measure using IF and ELSE condition

Something like DATA = If(TableA= "ABCD", "LARGE", "SMALL")

I need to create this as a measure because i need to use it in another measure which where i will be using this XYZ and another number condition

1 ACCEPTED SOLUTION

Accepted Solutions
v-jiascu-msft Super Contributor
Super Contributor

Re: Create Non Numeric (String) measure using IF and ELSE condition

Hi @Diledre,

 

You can simply add "min" or "max" to the column. Please refer to the snapshot below. BTW, a measure needs the context in the visual.

 

MeasureName =
IF ( MIN ( Table1[ColumnA] ) = "ABCD", "LARGE", "SMALL" )

 

Create-Non-Numeric-String-measure-using-IF-and-ELSE-condition

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
reza_rad Regular Visitor
Regular Visitor

Re: Create Non Numeric (String) measure using IF and ELSE condition

A table cannot be equal to a text value. In DAX, you cannot say TableA="ABCD". If you want a cell value to be equal to that, you have to mention the column name, and also filter the rows to get to the row that you want. Or alternatively, you have to use functions that search the entire column, such as Contains.

Diledre Frequent Visitor
Frequent Visitor

Re: Create Non Numeric (String) measure using IF and ELSE condition

Sorry it should have been  MeasureName = If(Table(ColumnA)= "ABCD", "LARGE", "SMALL")

v-jiascu-msft Super Contributor
Super Contributor

Re: Create Non Numeric (String) measure using IF and ELSE condition

Hi @Diledre,

 

You can simply add "min" or "max" to the column. Please refer to the snapshot below. BTW, a measure needs the context in the visual.

 

MeasureName =
IF ( MIN ( Table1[ColumnA] ) = "ABCD", "LARGE", "SMALL" )

 

Create-Non-Numeric-String-measure-using-IF-and-ELSE-condition

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Diledre Frequent Visitor
Frequent Visitor

Re: Create Non Numeric (String) measure using IF and ELSE condition

Thanks for the reply.. I was able to create the measure with the "min" function on Friday, Appreciate your response.

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: 308 members 3,080 guests
Please welcome our newest community members: