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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

copying "text" with if statement

Hey guys,

 

I'm trying to create a FTR (First time right).

The table creates "Fout" (False) as the text condition isn't correct.

To put it simple I'm trying to create that the text "Fout" will be copied to all the same 70X-XXX values. 

 

For example in the picture:

- 704-434 -> "Loopactie opruimen" -> "Fout"

- 704-434 -> "Voorbereiden" -> "Fout" (currently returned as a null value)

 

What I need:

- A method to copy the "Fout" text if the conditions are correct

(as one of the 70X-XXX values contains a "Fout" text in the other column.  The other 70X-XXX values with the same numbers should also have the "Fout"

 

aanvullen fout waardes.PNG

 

With Kind regards,

 

SRMulti

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous 

You make it difficult to answer your question. You don't specify the names of the columns plus the sample data provided is a screen cap, which can not be copied and thrown into PBI to make a test.

This is a solution in DAX. I f you want it in Power Query please provide sample data in text-tabular format so that it can be copied.

Assuming the column with the 70X-XXX values is called Code and the column with the "Fout" and nulls is called Status, then create a new calculated column in your table (Table1):

New col =
VAR commonStatus_ =
    CALCULATE ( MAX ( Table1[Status] ), ALLEXCEPT ( Table1, Table1[Code] ) )
RETURN
    IF ( ISBLANK ( Table1[Status] ), commonStatus_, Table1[Status] )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors