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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

How to express an if function with multiple columns filtered

Hello Expert.

 

I try to do a logic but it resulted to syntax error. What I want is having a multiple columns to filter. So for example how to express this scenario.

If column A, B, C, D, E, F, G, H, I,J, K, L, M & N is false then "With Changes" if true " No Changes"

 

How can I express this formula without having an error and will work? Please advise.

 

Thank you

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous

 
Hope you need a DAX solution?. Add the following Column to your table and modify the column names as required

Column = 
VAR T = {[A],[B],[C],[D]} RETURN
SWITCH( TRUE() ,
    CONTAINS(T,[Value],FALSE()), "With Changes",
    CONTAINS(T,[Value],TRUE()), "No Changes",
    "Unknown"
    )

Fowmy_0-1600606622644.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Sumanth_23
Memorable Member
Memorable Member

hi @Anonymous - If the condition needs to check if ALL columns to be FALSE for the derived column to have the value "With Changes" then you can implement a logic as seen below. 

 

Status =
IF (
Sample_Data[Flag1] = FALSE() &&
Sample_Data[Flag2] = FALSE() &&
Sample_Data[Flag3] = FALSE() &&
Sample_Data[Flag4] = FALSE() &&
Sample_Data[Flag5] = FALSE(),
"With Changes",
"No Changes"
)
 

Sumanth_23_0-1600621025607.png

 

Please mark the post as a solution and provide a 👍 if my comment helped with solving your issue. Thanks!

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



Fowmy
Super User
Super User

@Anonymous

 
Hope you need a DAX solution?. Add the following Column to your table and modify the column names as required

Column = 
VAR T = {[A],[B],[C],[D]} RETURN
SWITCH( TRUE() ,
    CONTAINS(T,[Value],FALSE()), "With Changes",
    CONTAINS(T,[Value],TRUE()), "No Changes",
    "Unknown"
    )

Fowmy_0-1600606622644.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thank you All for taking time to answer my questions and I've got the right formula from @Fowmy  Thank you for the help!

 

You all stay safe and thanks again

darentengmfs
Post Prodigy
Post Prodigy

Hi @Anonymous 

 

Can you share an example of the data and what you want it to look like?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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