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 https://www.daxformatter.com/.
- Click on the HTML button in the top bar of the post (you may need to click "..." to have it show)
- Paste in the <div></div> tag below.
- Copy DAX expression.
- Paste into https://www.daxformatter.com/ and then click "Copy HTML".
- Paste in the HTML DAX code from dax formatter before </div> (where the comment is).
- 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 DAXFormatter.com HTML code here -->
</div>
This will format the DAX expression to look like this:
Measure Cumulative =
CALCULATE (
[Measure],
FILTER (
ALLSELECTED ( 'Date'[Date] ),
ISONORAFTER ( 'Date'[Date], MAX ( 'Date'[Date] ), DESC )
)
)
CALCULATE (
[Measure],
FILTER (
ALLSELECTED ( 'Date'[Date] ),
ISONORAFTER ( 'Date'[Date], MAX ( 'Date'[Date] ), DESC )
)
)
Updated 5 years ago
Version 3.0DataZoe
Microsoft Employee
Joined April 03, 2020
Power BI Community Blog
On this blog you will find articles, guides and information created by our community members and, from time to time, roundups and community news.
If you are interested in becoming a community blog author, send a private message to Natalie_iTalent. An overview of the community blogs can be found here.