Forum Discussion
Current Month - Previous Month
If you're attempting to compared MONTH(TODAY()) with a month column where's it's spelled out, it would be best to use the FORMAT function to change the 8 from the MONTH output to the correct format.
if a fully spelled out month is your desired comparison it would be best to use a function like:
FORMAT( MONTH(TODAY()), "mmmm")
The amount of M's in the second argument determines the length. See this article for more info: Format Function Microsoft Learn
Getting the value of the previous month could be accomplished with a CALCULATE function:
CALCULATE( SUM( TABLE[Sales]), TABLE[Month] = FORMAT( MONTH(TODAY()) -1), "mmmm")
Subtracting inside the FORMAT function will help it to be dynamic without using another measure!
Thanks! I hope this helps. If it has, please accept it as the solution. 🙂