Forum Discussion

edhans's avatar
edhans
Community Champion
6 years ago

The Insert Code button no longer visible by default

When I go to post, the Insert/Edit Code Sample button (the one that looks like </> ) is no longer visible unless I hit the ellipses and show the full toolbar. That button is super helpful and seems to me to be more useful than the Spoiler button or many other buttons. This is a recent change. I've noticed it this past week.

 

Can we get it back on the default toobar? Makes it so much easier to read longer M and DAX statements.

3 Replies

    • edhans's avatar
      edhans
      Community Champion

      Thanks. There are two issues I see, and both relate to pasted code, something done a lot on this forum.

       

      1) With the code button hidden, we are more likely to have people, potentially new people, not even know an Insert Code button exists, those of us trying to assist get something like this:

      NY 2007 Old 2 :=
      CALCULATE (
      [Sales Amount],
      FILTER (
      ALL ( 'Calendar' ),
      CONTAINS (
      DATATABLE (
      "Year", INTEGER,
      "Month", STRING,
      {
      { 2006, "December" },
      { 2007, "January" }
      }
      ),
      [Year], 'Calendar'[Year],
      [Month], 'Calendar'[MonthName]
      )
      )
      )

       

      vs something like this:

      NY 2007 Old 2 :=
      CALCULATE (
          [Sales Amount],
          FILTER (
              ALL ( 'Calendar' ),
              CONTAINS (
                  DATATABLE (
                      "Year", INTEGER,
                      "Month", STRING,
                      {
                          { 2006, "December" },
                          { 2007, "January" }
                      }
                  ),
                  [Year], 'Calendar'[Year],
                  [Month], 'Calendar'[MonthName]
              )
          )
      )

       

      The former being impossible to read, the latter being easy to read.

       

      2) Additionally, it seems the code box no longer scrolls to the right

       

      let
          Source = Folder.Files("C:\Users\my secret location of a bunch of files anyone can download\Classes\Collect Combine and Transform Data using PowerQuery eBook\Chapters\C04\C04E04 - Products"),
          #"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
          #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
          #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
          #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
          #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File")))
      in
          #"Expanded Table Column1"

      So instead of scrolling, we get this weird wrap that makes code, most notably M code that can be really long, hard to read. Vs the horizontal scroll bar that kept the wraps where they belonged vs arbitrarily setting them.

       

      I'd much rather the strike through & Insert Spoiler Tag icons be in the advanced bar and the Insert Code be on the main tool bar. I don't even know what the spoiler tag would be used for on this site. Even the video button will be used pretty rarely.

       

      Maybe there are some stats from the old site where someone could see how often things like Code were used vs Strike Through or Spoiler? I'd be surprised if the latter two were used much. Not never to be sure, but Code should be used in virtually every thread at some point, either by the OP or the one trying to answer, at least on questions that involve DAX or Power Query M code.

       

      Thanks for the response Anonymous.