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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ROG
Responsive Resident
Responsive Resident

New column based on another two columns

Hi all,

 

I'm trying to create a new column based on the two columns below highlighted in pink. 
The new column should say Yes if these two columns have "Yes" and No if one of them is "No".
I tried the the dax below, but it won' work. 

ROG_0-1655389799442.png


Thank you

RG

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@ROG Try:

RETURN IF(Flag8Wk_CNSize = 1 && _8WkSigTest = 1, "Yes", "No")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

ROG
Responsive Resident
Responsive Resident

Thanks a million @tamerj1  
I was indeed using a wrong measure. The below worked. 

8WK CN Size_SigTest =
VAR _8WkSigTest = IF([CHI_SQUARE_TAKERS_8_WK_ACTIVE] = "Yes", 1, 0)
VAR Flag8Wk_CNSize = IF([flag_8_wk] = "Yes",1, 0)

Return IF( _8WkSigTest = 1 && Flag8Wk_CNSize = 1, "Yes", "No")

View solution in original post

6 REPLIES 6
tamerj1
Community Champion
Community Champion

Hi @ROG 

after RETURN change the && to + and change the 1 to 2

Greg_Deckler
Community Champion
Community Champion

@ROG Try:

RETURN IF(Flag8Wk_CNSize = 1 && _8WkSigTest = 1, "Yes", "No")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
ROG
Responsive Resident
Responsive Resident

Thanks for your reply @Greg_Deckler 
It's not working because o the data type. 
The two measures I used to create the new column a type= text, but the new one I changed from number to general. There isn't an option to change to text for this measure. What woul you do in this case? 

ROG_0-1655452978661.png

 

Greg_Deckler
Community Champion
Community Champion

@ROG It would appear that one or both of the columns/measures that you have highlighted are returning numbers and not text. So, you need to address those comparisons. Are they really returning "Yes" and "No"? Doesn't seem like it.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 
The issue is that @ROG is trying to compare a measure of type percentage ( [8 WK Diff %] ) with a text ("Yes"). Better if he advises what is he trying to achieve.

ROG
Responsive Resident
Responsive Resident

Thanks a million @tamerj1  
I was indeed using a wrong measure. The below worked. 

8WK CN Size_SigTest =
VAR _8WkSigTest = IF([CHI_SQUARE_TAKERS_8_WK_ACTIVE] = "Yes", 1, 0)
VAR Flag8Wk_CNSize = IF([flag_8_wk] = "Yes",1, 0)

Return IF( _8WkSigTest = 1 && Flag8Wk_CNSize = 1, "Yes", "No")

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.