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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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