Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have data spanning over 4 years from a lead generation system. At some point a data field called "State" was used and later they started using another field called "Province".
What I have - two columns with some data, some blank fields and sometimes a value in both columns.
I would like to create a third column where I combine the data from the first two columns, but in instances where both columns have data, I want the data from "Province" to be in the Combined column and discard the value from "State".
I know how to combine data, but I don't know how to end up with only the single values when there are two values per row.
Solved! Go to Solution.
Hi @lovetolearn ,
You can try the formula like below:
Col =
IF (
'Table'[State] = BLANK ()
&& 'Table'[Provice] = BLANK (),
BLANK (),
IF (
'Table'[Provice] <> BLANK ()
&& 'Table'[State] <> BLANK (),
'Table'[State],
IF (
'Table'[State] = BLANK ()
&& 'Table'[Provice] <> BLANK (),
'Table'[Provice],
'Table'[State]
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lovetolearn ,
You can try the formula like below:
Col =
IF (
'Table'[State] = BLANK ()
&& 'Table'[Provice] = BLANK (),
BLANK (),
IF (
'Table'[Provice] <> BLANK ()
&& 'Table'[State] <> BLANK (),
'Table'[State],
IF (
'Table'[State] = BLANK ()
&& 'Table'[Provice] <> BLANK (),
'Table'[Provice],
'Table'[State]
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for this solution, it worked perfectly.
Do you know how I can accomplish this with an M Query so I can add it as an automatic step whenever I import updated data?
a new column in dax = coalesce([State], [province] )
In power query
if [State] = null then [province] else [province]
@amitchandakThanks for the reply. The logic seems right but it doesn't quite work. This is my result:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
78 | |
41 | |
40 | |
35 |