March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I have a client masterfile table included in my data model. The table is linked in DirectQuery mode from a SQL Server. In the table query I have added some lines to mock up the data but when I try to replace values in a column based on condition I fail and get the following message:
This is the step I need to do:
= Table.ReplaceValue(#"Filtered Rows", each [Group], each if [Group] = "” then [Company] else [Group], Replacer.ReplaceValue, {"Group"})
Practically I need to have all cells in column Group filled either with the preexisting value or with the value present in the Company column (both text fields)
I can't believe this is not possible in DirectQuery mode. What am I doing wrong?
Thanks,
C.
Hi there, thanks for your reply.
I did actually try the first method above and it did not work. After adding the new column I couldn’t populate it conditionally and got the same message. I will try the second solution (If I can find the way). At the end if nothing works I will accept the import mode but we are talking about a very large table to be possibly used in several reports and would be a real waste of space.
Many thanks indeed; I will let you know how it goes.
Regards,
C.
@Anonymous,
One approach would be to add a custom column in Power Query with the "if" statement, and then remove the original column Group. You could also use custom SQL with a CASE statement. With custom SQL, you'll need to put all transformations in the SQL (no M transformations).
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
73 | |
67 | |
49 |
User | Count |
---|---|
199 | |
141 | |
97 | |
79 | |
68 |