Enable Regex to increase the power of powerquery. Some function such as split column and extract are good but could be great if custom regex could be used to pattern match more effectively.
zack-c
3 months agoRegular Visitor
When dealing with messy data, it's often paramount to do some text transforms to clean it up a little. I end up writing a lot of regex and just having ChatGPT translate it into Power Query steps/functions because manually transforming text is such a pain in Power Query without regex. It's very quick for me to write regex due to how close the final syntax usually is to the text I'm matching.
For context, a simple regex-based prefix matcher like this:
^[A-Z]{3}-\d{4}\s*(?=\D)
Translates into a Power Query function along the lines of:
(text as nullable text) as nullable text =>
let
t = text,
Prefix = if t <> null and Text.Length(t) >= 8
then Text.Start(t, 8)
else "",
ValidPrefix =
Text.Length(Prefix) = 8 and
Text.Middle(Prefix, 3, 1) = "-" and
// First 3 uppercase letters
List.AllTrue(
List.Transform(
Text.ToList(Text.Start(Prefix, 3)),
each Character.ToNumber(_) >= 65 and Character.ToNumber(_) <= 90
)
) and
// Last 4 digits
List.AllTrue(
List.Transform(
Text.ToList(Text.End(Prefix, 4)),
each Character.ToNumber(_) >= 48 and Character.ToNumber(_) <= 57
)
),
AfterPrefix =
if ValidPrefix
then Text.Range(t, 8)
else t,
TrimmedAfter =
if ValidPrefix
then Text.TrimStart(AfterPrefix)
else t,
// Lookahead equivalent: next char must be non-digit (or absent)
NextCharValid =
Text.Length(AfterPrefix) = 0 or
not List.Contains({"0".."9"}, Text.Start(TrimmedAfter, 1)),
Result =
if ValidPrefix and NextCharValid
then TrimmedAfter
else t
in
Result
Recent ideas
Allow report creators to download their Own PBIX even when Downloads are restricted at tenant level.
In the current Power BI permission model, PBIX downloads are controlled exclusively through tenant‑level export settings and workspace roles. This creates a significant limitation for multi‑agency or...pbiuserNC2 hours agoNew MemberNew8Views0likes0CommentsNative KPI Governance, Ownership and Business Change Impact in Microsoft Fabric
Native KPI Governance, Ownership and Business Change Impact in Microsoft Fabric Idea In enterprise analytics, one of the biggest challenges is not creating a KPI, but ensuring that everyone agrees ...kulkarnigauri36 hours agoNew MemberNew3Views0likes0CommentsEnable writing PowerQuery type time (from Dataflow Gen2) to Warehouse type time
Currently the UI throws an error while I am trying to write Data typed as "time" in Power Query to a Fabric Warehouse. I would prefer to import data typed as "time" in Dataflow Gen2 PowerQue...pyd4life9 hours agoAdvocate INew105Views2likes1Comment