Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Folks,
I am trying to get dynamic title for my card visual. It should display previous month. I used below DAX.
Solved! Go to Solution.
Hi @Anonymous ,
The reason your DAX formula is returning January is that formatting using "MMM" requires a complete date, not just a month number. There are several ways to achieve your desired output, and one approach is as follows:
Previous Month = format(edate(today(),-1),"MMM")
Best regards,
Thanks to DataNinja777 for providing a correct answer.
Hi @Anonymous ,
Here I will provide another method for reference:
As DataNinja777 said, formatting using "MMM" requires a complete date.
So the SWITCH function can be used to manually map the month names:
Previous Month =
SWITCH (
MONTH ( TODAY () ) - 1,
1, "Jan",
2, "Feb",
3, "Mar",
4, "Apr",
5, "May",
6, "Jun",
7, "Jul",
8, "Aug",
9, "Sep",
10, "Oct",
11, "Nov",
12, "Dec"
)
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @Anonymous ,
The reason your DAX formula is returning January is that formatting using "MMM" requires a complete date, not just a month number. There are several ways to achieve your desired output, and one approach is as follows:
Previous Month = format(edate(today(),-1),"MMM")
Best regards,
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |