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.
Hello!
I have 3 columns [Job Number]; [Job Name] and [Client].
I need a new column [Job Info] createdbased off one (or two) of the above columns depending on the populated data.
Ideally, the [Job Info] column would:
Concatenate [Job Number] and [Job Name]
but if [Job Number] = null then I just want [Job Name] returned
if both [Job Number] and [Job Name] = null I want [Client] returned
And if none of the above columns are populated, I just want null returned.
Seems basic, but I can't think of how to do this!
TIA
Solved! Go to Solution.
if [Job Number] <> null and [Job Name] <> null
then
Number.ToText([Job Number])&[Job Name]
else if [Job Number] = null and [Job Name] <> null
then
[Job Name]
else
[Client]
@JNelson If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.
This works! Thank you so much
Hello @JNelson ,
you could add a conditional column using power query, check this link for instructions https://learn.microsoft.com/en-us/power-query/add-conditional-column
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Proud to be a Super User! | |
Hello,
Thanks for your reply. I have tried using 'add conditional column' however it doesn't allow the 'and' argument. As I am trying to return the Client name if the Job Number AND Job Name are both blank on the row...
Thanks
JOB INFO =
IF (
JOB[Job Name] <> BLANK ()
&& JOB[Job Name] <> BLANK (),
CONCATENATE ( JOB[Job Number], JOB[Job Name] ),
JOB[Client]
)
*Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Thanks for your reply. This looks like DAX not M code...? Don't I need M for Power Query? It's not recognising BLANK or &&.
Below is a screenshot of a sample data. The "Job Info" column is the desired outcome.
if [Job Number] <> null and [Job Name] <> null
then
Number.ToText([Job Number])&[Job Name]
else if [Job Number] = null and [Job Name] <> null
then
[Job Name]
else
[Client]
@JNelson If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
13 | |
11 |