From ac0df8b6baefcf4c0295611172a84ca956b89f6a Mon Sep 17 00:00:00 2001 From: Alberto Spelta Date: Fri, 15 Mar 2024 14:36:52 +0100 Subject: [PATCH] Fix missing `]` escape in time intelligence measure expressions (#42) Fix an issue that generates an invalid time intelligence expression when the base measure name contains a closed square bracket character. --- src/Dax.Template/Measures/MeasureTemplateBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dax.Template/Measures/MeasureTemplateBase.cs b/src/Dax.Template/Measures/MeasureTemplateBase.cs index a98022e..997600a 100644 --- a/src/Dax.Template/Measures/MeasureTemplateBase.cs +++ b/src/Dax.Template/Measures/MeasureTemplateBase.cs @@ -256,7 +256,7 @@ public virtual string GetDaxExpression(TabularModel model, string? originalMeasu string.IsNullOrWhiteSpace(templateName) ? originalMeasureName : Template.GetTargetMeasureName(templateName, originalMeasureName); - return $"[{replaceMeasureName}]"; + return $"[{replaceMeasureName.Replace("]", "]]")}]"; }); } else