Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
skasper
Responsive Resident
Responsive Resident

DAX syntax highlighting in Notepad++

Hi,

 

ever since my DAX statements got more advanced, I found the code window in Power BI Desktop too small and wanted to use Notepad++ for it. Alas, there is no pre-defined syntax highlighting for DAX. So I went ahead and created my own. I share instruction on how to do that and also the already prepared XML file for easy import into Notepad++ over here: www.sascha-kasper.com/dax-syntax-highlighting-for-notepad/

 

You can have DAX syntax highlighing inside Notepad++ within 1 minute after reading this.

 

I hope it helps you as it helps me.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.
3 ACCEPTED SOLUTIONS

Thank you. I am glad you find it useful.

 

I am currently working on auto-complete, but this seems a bit buggy.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

View solution in original post

skasper
Responsive Resident
Responsive Resident

Hi again,

 

I updated the DAX.xml file for Notepad++. It now also offers AutoComplete.

Just download it again and replace the old one.

Make sure you use the latest version (2.05) by checking the comment inside the file.

Let me know, if it works.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

View solution in original post

skasper
Responsive Resident
Responsive Resident

Updated the file (now version 3.01) to include

  • Parameters
  • Return Value
  • Description

See the screenshots in the updated post for details.

I did only preliminary testing, so if you find any issues, please let me know.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

View solution in original post

19 REPLIES 19
j1s
Frequent Visitor

So @skasper - just checking: we need to pay you for these, and give you email addresses right? 

Anonymous
Not applicable

Hi @skasper ,

 

Thanks for the xml and blog - realy hepful!

 

I'm new to Notepad++ sorry, but I was wondering how to parse/format the code so that it steps/indents nicely. Is that possible?

 

Cheers,

Craig

diegomsg
Frequent Visitor

Just downloaded version 4.00. Great improvementes for dark mode. Now I don't need to tweak it anymore. Great job.

Rygaard
Resolver I
Resolver I

Thank you !

skasper
Responsive Resident
Responsive Resident

Hi,

 

updated the file again with new functions (see change log on the web site).

 

Also, I did the same exercise for M (Power Query). You can find that here.

 

I hope they help you.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Hi I am getting a Failed to Import Error for the DAX.xml

 

Thanks Rodney

skasper
Responsive Resident
Responsive Resident

Hi Rodney,

 

I fixed the import file (had forgotten to close a tag). It is working now as it should. Sorry for the inconvenicence. Please find the udpdated file online at the link provided in my post.

 

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Hi, Im trying the DAX highlihting file, works perfect, but I cant make the autocomplete work, is there something to do to enable this functionality?

thanks @skasper !

 

skasper
Responsive Resident
Responsive Resident

Updated the xml file for Notepad++ with the latest DAX functions, giving you syntax highlighting and auto complete.

Find the file and instructions here

ISINSCOPE
COMBINEVALUES
UTCNOW
UTCTODAY
NORM.DIST
NORM.INV
NORM.S.DIST
NORM.S.INV
T.DIST
T.DIST.2T
T.DIST.RT
T.INV
T.INV.2T

 

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.
skasper
Responsive Resident
Responsive Resident

Updated the file (now version 3.01) to include

  • Parameters
  • Return Value
  • Description

See the screenshots in the updated post for details.

I did only preliminary testing, so if you find any issues, please let me know.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

I tried the step by step screenshots, but I guess it skips to a part where you should have loaded the XML file and doesn't show how to do it. Only at the end of the post it says how to import.

 

Somehow, I imported but the functions don't appear in the supposed box.

 

What am I doing wrong?

 

I'm using Notepad++ 7.5.6 64-bits

skasper
Responsive Resident
Responsive Resident

Hi @zapppsr,

thank you for pointing this out. I just updated the blog post to include a screenshot showing the 3 clicks for importing the XML file (I am using the same Notepad++ version as you).

 

I also double-checked the file and after importing it, highlighting and auto-complete work as they should. If you keep experiencing issues, please check the Notepad++ Wiki (http://docs.notepad-plus-plus.org/index.php/Main_Page).

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.
skasper
Responsive Resident
Responsive Resident

Hi again,

 

I updated the DAX.xml file for Notepad++. It now also offers AutoComplete.

Just download it again and replace the old one.

Make sure you use the latest version (2.05) by checking the comment inside the file.

Let me know, if it works.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.
Greg_Deckler
Super User
Super User

This is great. The only issue that I had is that every time I click on Styler in the 64-bit version of Notepad++ it errors out, but that's not your issue! Thanks for putting this together!! The import worked awesome, that's definitely the way to go!!



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler. Much appreciated. Glad it helps.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Hi @skasper,

 

Thanks for replying and updating the post so quickly.

Maybe because I'm new to Notepad++ I missed the step where I should select the DAX language after Importing it.

Your new screen is good, but I would highlight for noobs like me that I have to select the language after importing...

Other than that, thanks a lot for providing this!

 

skasper
Responsive Resident
Responsive Resident

true. I added a sentence or two to explain this, too. Enjoy!

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Thanks!

Thank you. I am glad you find it useful.

 

I am currently working on auto-complete, but this seems a bit buggy.

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.