Showing results for 
Search instead for 
Did you mean: 

How did I format my DAX expression in a post?

To format a DAX expression, I utilize the HTML view of the posts to copy in a formatted div tag and the html of the formatted DAX expression generated by


  1. Click on the HTML button in the top bar of the post (you may need to click "..." to have it show)
  2. Paste in the <div></div> tag below.
  3. Copy DAX expression.
  4. Paste into and then click "Copy HTML".
  5. Paste in the HTML DAX code from dax formatter before </div> (where the comment is).
  6. Click OK.

The formatted <div> tag (which can be further modified as you like!):


<div style="background: #F5F2F0; border: 1px solid lightgrey; border-radius: 10px; padding: 10px 10px 10px 10px; font-family: Courier, monospace; margin: 5px 5px 5px 5px; font-size: 12px;">
<!-- Insert HTML code here -->




This will format the DAX expression to look like this:

Measure Cumulative =
    FILTER (
        ALLSELECTED ( 'Date'[Date] ),
        ISONORAFTER ( 'Date'[Date], MAX ( 'Date'[Date] )DESC )