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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Antonio_Gomez
Resolver I
Resolver I

Change Row Value according other Row Value in the same column

Hello Everyone!

 

I'm having this issue that I'm sure you can easily help me.

 

In one table I have a column with "Issue_ID" and other column with the text "No Plan" or "Plan".

 

I would like that if I have one Issue_ID with the word "Plan", the other same Issue_ID must say "Plan".

 

For example, all the Issue_IDs 17993 must say "Plan". And not like the picture bellow that for the "gestion" row says "No Plan" and for the "00-Planificado" says "Plan". In this case, both must say "Plan"

 

Antonio_Gomez_0-1656083572823.png

 

1 ACCEPTED SOLUTION

Sorry @speedramps , but my native language is Spanish, maybe for this I can't explain so well.

 

A friend of mine just gave me the solution. But in the same way I explain and put the solution.

 

This is the original table:

Antonio_Gomez_1-1656412003916.png

 

 

And, this is what I need:

Antonio_Gomez_0-1656411840485.png

 

Like the issue 13179 has in "ListaEtiquetas" column (In the original table was "Name" column) the word "Planificado", all the issues 13179 should say "Plan". But, the issues where they are not related to "Planificado" should say "No Plan". Like for example the issue 13120 it has "Desarrollo" and "Gestión" but there is no "Planificado" for that says "No Plan".

 

The solution was create a table and a list in Power Query.

 

We create a Group by for the column "Name" with this:

= Table.Group(#"Replaced Value", {"ISSUE_ID"}, {{"TablaEtiquetas", each _, type table [NAME=nullable text, ISSUE_ID=nullable number]}})

Antonio_Gomez_4-1656412889010.png

 

 

Then we add a column group and eliminated the issue column:

= Table.AddColumn(#"Grouped Rows", "Custom", each Table.RemoveColumns([TablaEtiquetas],{"ISSUE_ID"}))

Antonio_Gomez_3-1656412864256.png

 

 

Create the "ListaEtiquetas" column from the previous created column "Custom":

= Table.AddColumn(#"Added Custom", "ListaEtiquetas", each Table.ToList([Custom]))

Antonio_Gomez_5-1656412959609.png

 

Then we created the "PlanNoPlan" column that I needed:

= Table.AddColumn(#"Added Custom1", "PlanNoPlan", each if List.Contains([ListaEtiquetas],"Planificado") then "Plan" else "No Plan")

Antonio_Gomez_6-1656413042401.png

 

 

 

 

 

 

View solution in original post

4 REPLIES 4
Antonio_Gomez
Resolver I
Resolver I

Hello @speedramps !!

 

Thanks for your help, but doesn't work correctly. Maybe I didn't explain well. This is the result using your DAX

 

Antonio_Gomez_0-1656338997845.png

 

There is missing data. The cases where the cell are empty are in which there are no relationship with "00-Planificado".

 

I wanted to create a new column starting from "Name" not from "PlanNoPlan".

 

This is the situation:

One issue can have several "Names" at the same time, in some cases one issue have the "Name" = 00-Planificado and in others not.

 

I wanted that for the cases when "Name" = 00-Planificado appears the others rows with the same issue_id have the value "Plan" and in the others "NoPlan"

Sorry I dont understand you, please translate to English

 

"I wanted that for the cases when "Name" = 00-Planificado appears the others rows with the same issue_id have the value "Plan" and in the others "NoPlan" does not make sense  ☹️

 

I want to help but it wastes your time and my time if you dont describe your problems carefully.

 

Please provide example imput date (as table not a screen print)

and example output.

Clearly showing what you want.

Witj a bried but clear decsription of what you want.

Thank you 😁

 

 

 

 

 

Sorry @speedramps , but my native language is Spanish, maybe for this I can't explain so well.

 

A friend of mine just gave me the solution. But in the same way I explain and put the solution.

 

This is the original table:

Antonio_Gomez_1-1656412003916.png

 

 

And, this is what I need:

Antonio_Gomez_0-1656411840485.png

 

Like the issue 13179 has in "ListaEtiquetas" column (In the original table was "Name" column) the word "Planificado", all the issues 13179 should say "Plan". But, the issues where they are not related to "Planificado" should say "No Plan". Like for example the issue 13120 it has "Desarrollo" and "Gestión" but there is no "Planificado" for that says "No Plan".

 

The solution was create a table and a list in Power Query.

 

We create a Group by for the column "Name" with this:

= Table.Group(#"Replaced Value", {"ISSUE_ID"}, {{"TablaEtiquetas", each _, type table [NAME=nullable text, ISSUE_ID=nullable number]}})

Antonio_Gomez_4-1656412889010.png

 

 

Then we add a column group and eliminated the issue column:

= Table.AddColumn(#"Grouped Rows", "Custom", each Table.RemoveColumns([TablaEtiquetas],{"ISSUE_ID"}))

Antonio_Gomez_3-1656412864256.png

 

 

Create the "ListaEtiquetas" column from the previous created column "Custom":

= Table.AddColumn(#"Added Custom", "ListaEtiquetas", each Table.ToList([Custom]))

Antonio_Gomez_5-1656412959609.png

 

Then we created the "PlanNoPlan" column that I needed:

= Table.AddColumn(#"Added Custom1", "PlanNoPlan", each if List.Contains([ListaEtiquetas],"Planificado") then "Plan" else "No Plan")

Antonio_Gomez_6-1656413042401.png

 

 

 

 

 

 

speedramps
Super User
Super User

Try this dax measure 

 

Answer =
VAR name_has_plan =
CALCULATE(
NOT(ISEMPTY(Facts)),
ALL(Facts[ISSUEID]),
Facts[PlanNoPlan] = "Plan"
)
RETURN
IF(name_has_plan,
"Plan",
SELECTEDVALUE(Facts[PlanNoPlan])
)
 
speedramps_0-1656089978398.png

 

Thanks for reaching out for help.

I have helped you, now please help me by giving kudos.

Remeber we are unpaid volunteers.

Click the thumbs up and accept as solution button. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !

 



 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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