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

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

Reply
tyan
Helper II
Helper II

Test and Measure ( Switch function )

8dddffa1877738ec6c7ca884af3c1c1.png

Hi, I tried to make above table in powerbi.

AD column is by measue : switch( trure(), AB>=7, "yes", "No"))
AE Column is by vlookup from other excel worksheet.  

 

My question is AD is a Measure, and AE is just pure column (TEXT). I would like to get AF Column, which is if both SIZE IN FULL & ON TIME are under YES situation than YES otherwise is NO.

I was wondering how could I write a dax function in BI simialar as I showed in Excel.   I can use 1 and 0 as my yes or no. but I still wondering if is still possible to keep YES/NO to have DIFOT. 

 

Thanks inadvance. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tyan ,

 

If AD is a measure, then AF needs to be a measure too.

You could create a new measure for AE then create a measure for AF:

AF = 
var _AE = selectedvalue([AE])

Return
IF([AD] = "Yes"&&_AE = "Yes", "Yes", 0)

If you want a column, then you will need to convert AD as a column.

It looks like the formula you used to create AD measure could be directly converted to a calculated column.

 

Best Regards,

Jay

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @tyan ,

 

If AD is a measure, then AF needs to be a measure too.

You could create a new measure for AE then create a measure for AF:

AF = 
var _AE = selectedvalue([AE])

Return
IF([AD] = "Yes"&&_AE = "Yes", "Yes", 0)

If you want a column, then you will need to convert AD as a column.

It looks like the formula you used to create AD measure could be directly converted to a calculated column.

 

Best Regards,

Jay

amitchandak
Super User
Super User

@tyan , for looupup , we have lookupvalue

 

Using the column name you can have

new column =

switch( trure(), [AB]>=7, "yes", "No")

 

 

new column =

If([Size in full] ="Yes" && [On Time] ="Yes",1,0)

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

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

@amitchandak thank you for that, but not sure how come my final step not working. 

tyan_0-1648017940168.png

 

@amitchandak  and i think the reason is new column, so i tried new meassure. but since my AE  is just a text download from excel. is it a meaure.  im not sure how to deal with it. could you give me any method or suggestion on this case? 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.