Forum Discussion

suebayes's avatar
suebayes
Icon for Resolver I rankResolver I
6 years ago
Solved

Tabular Editor FYTD

I am trying to create a Fiscal YTD measure in Tabular Editor but am getting stuck on the code to include a text value at the end of the YTD, I've tried to create a variable but the endYear has to be ...
  • suebayes's avatar
    suebayes
    6 years ago

    I think I have worked it out

    // Creates a TOTALYTD measure for every selected measure.
    foreach(var m in Selected.Measures) {
    m.Table.AddMeasure(
    m.Name + " YTD", // Name
    "TOTALYTD(" + m.DaxObjectName + ", 'Date'[Date], " + "\"31/05\")", // DAX expression
    m.DisplayFolder // Display Folder
    );
    }