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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ManjunathaEP
Helper II
Helper II

New column with if condition and filter

Hi, Please help to create a new column for the below sample:

order NoCust NameY/N?AmountNew column
111ABCY100Flex
112XYZN22Flex
113ABCN300Flex
114XYZY66Flex
115DFGN667NonFlex
116DDFY567NonFlex

New column = I want the results as flex or nonflex. 

"Flex" should be the customers have orders for both "Y/N" in Y/N? column

"Nonflex" should be the customers are not having orders either by Y or N in the Y/N? column

 

Thank you in advance

2 REPLIES 2
amitchandak
Super User
Super User

@ManjunathaEP , Try a new column like

if(calculate(distinctCOUNT([Y/N?]), filter(Table,[Cust Name] =earlier([Cust Name])))=2, "Flex","NonFlex")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

  • Hi, Thank you for the response, the given DAX is calculated flex and non flex by customer name.
  • I hope, I have not explained correctly in my 1st message, The actual requirement is to link flex or non flex for each row based on the "distinct" order number and distinct customer name by column name Y/N?
  • Flex: If column Y/N? equals Y and N, then it should be Flex for those distinct orders and distinct customers
  • NonFlex" If column Y/N? Y OR N, then it should be NonFlex for those distinct orders and distinct customers  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.