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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
the75th
Regular Visitor

Making this more concise

Hey guys, I've (nearly) finished a model and I'm looking to make the queries more concise and improve the performance. Essentially what it does is the following: 8 columns over 2 tables ( 4 and 4) I need to compare them with each other and visualize the difference in the strings So I used this function in a calculated column IF(isblank(Column1) = true; blank(); if(Column1 = related(Column1');1;0) for each column. (Many values are blank and I don't want to be comparing those) Now, the thing is that the comparison is pretty all or nothing. As soon as ANY column has a '0' the entire record should be 0. So I wrote something along the lines of: IF(Column 1 <> 1 || column 2 <>1 || column 3 <> 1 || column 4 <>1;0;1) Just this final function is failing me. How would you guys solve this problem? Also I can't provide sampels or screenshots as the database contains personal information. I could however create a mock-up when I get home if it's necessary.

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @the75th

 

You may try to use below measure. If it is not your case, please share a simplified data sample and expected output.

 

Column  =
IF (
    SELECTEDVALUE ( Table3[Column1] ) = 0
        || SELECTEDVALUE ( Table3[Column2] ) = 0
        || SELECTEDVALUE ( Table3[Column3] ) = 0,
    0,
    1
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @the75th

 

You may try to use below measure. If it is not your case, please share a simplified data sample and expected output.

 

Column  =
IF (
    SELECTEDVALUE ( Table3[Column1] ) = 0
        || SELECTEDVALUE ( Table3[Column2] ) = 0
        || SELECTEDVALUE ( Table3[Column3] ) = 0,
    0,
    1
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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