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
fonsogijon
Frequent Visitor

Check if more than one column has value

Hello,

 

I have created a calculated table as follows and I would like to create a calculated column called "Repeated" doing the following:

IDCol1Col2Col3Col4Repeated
AAA1    
BBB 12 Yes
CCC 3 5Yes
DDD  4  
EEE3  6Yes
FFF 251Yes

 

[Repeated] would be a calculated column that if two or more columns contains a value then it returns "Yes".

All rows have value, but only want to get where rows has values in two or more columns.

The way I was doing it was using IF:

 

Repeated = IF([Col1]>0 && [Col2]>0,"Yes",IF([Col1]>0 && [Col3]>0,"Yes",IF([Col3]>0 && [Col2]>0,"Yes")))
 

But I did when have 3 columns, now I have 4 and I can have more in the future, so I'm asking if you know a better way and simpler way to get that goal.

 

Thank you in advance!!

1 ACCEPTED SOLUTION
fonsogijon
Frequent Visitor

I have just realized I can do it with CONCATENATE and LEN:

 IF(LEN(CONCATENATE([Col1], CONCATENATE( [Col2], CONCATENATE([Col3], [Col4]))))>=2,"Yes")

View solution in original post

1 REPLY 1
fonsogijon
Frequent Visitor

I have just realized I can do it with CONCATENATE and LEN:

 IF(LEN(CONCATENATE([Col1], CONCATENATE( [Col2], CONCATENATE([Col3], [Col4]))))>=2,"Yes")

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.