Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tylerdv
Frequent Visitor

If x = A,b,c,d True, it not, false

Hi All

 

Getting into something that would be pretty easy in Excel but im struggling in Power BI

 

I have a list of product, some of them are current, some of them are legacy

 

I want a formula that creates a new column, marking it as current or legacy

 

EG, IF (X = A or B or C, Current, Legacy)

 

What would be the easiest way to do this? Can i also point X to look at a seperate Table (there is quite a few current products, but even more legacy ones)

 

Thanks heaps in advance

Tyler

2 REPLIES 2
Phil_Seamark
Employee
Employee

HI @tylerdv

 

Are A, B & C columns in a table or hardcoded measures?  

 

Cheers,

 

Phil


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

MarcelBeug
Community Champion
Community Champion

In the query editor, you can add a column with formula:

 

= if List.Contains({4,5},[ProdID]) then "Current" else "Legacy"

 

{4,5}  is the list with current products, which might be replaced by a table/column, e.g. CurrentProducts[ProdID]

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.