Note to Self: Some useful DAX commands which I keep forgetting

Over time, I will add to this list. I want to keep an online copy of DAX commands so I can copy and paste them for future Power Pivots.

When you have an integer and want to convert it into HH:MM or HH:MM:SS format
=FORMAT(TIME(0,0,’CiscoData'[queuetime]),”hh:mm:ss”)

When you want to create a key from a standard date. This will take care of adding in a prefixing zero if the month is January (1) to September (9)
=YEAR(Issues[Logged Date])& FORMAT(MONTH(Issues[Logged Date]),”00″) & FORMAT(DAY(Issues[Logged Date]),”00″)

Creating an index in PowerPivot
=CALCULATE(COUNT(Issues[Logged Date]), ALL(‘WorksheetName’), FILTER(‘WorksheetName‘, Issues[Logged Date]<=EARLIER(Issues[Logged Date])))

This list will grow over time. I just got fed up with forgetting these DAX commands!

Leave a Reply