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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.