cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

PreviousMonth Name to Display in Texbox

Hi all,

 

I would like to display PreviousMonth name by comparing Today() currentmonth-1.

 

Thanks,

Vijay.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: PreviousMonth Name to Display in Texbox

Hi Thanks Remi,

 

this works fine but thing is i would like to add this as a Dynamic text into my text box.

so i created this (Previous month = FORMAT(DATE("2000";MONTH(TODAY())-1;"01");"mmmm") as mesure 

and tried to put in text box but it is not taking,but when i keep in Card it is working.

 

my actual requirement is to Display "January2017 Month Leaves" bold text along other text i want display in text box.

 

my query here is Can't we Display Measure along some Static Text in Text box.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: PreviousMonth Name to Display in Texbox

Hi @Anonymous,

 

As you know, textbox only supports static text content, we are not allowed to add a measure into it.

 

To work around your requirement, you can append the static text to the dynamic Month value in measure and display it in Card visual. However, the limitation is that we cannot set "January2017" and "Month Leaves" to different font formats.

The measure could be:
Previous month = FORMAT(DATE("2000";MONTH(TODAY())-1;"01");"mmmm") & " Month Leaves"

 

Alternatively, you can use a Card to display dynamic Month value and use Text box to display static text. Adjust the position of Card to make it locate inside the Textbox so that the text looks like a entirety.

2.PNG

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Resolver III
Resolver III

Re: PreviousMonth Name to Display in Texbox

Hello,

 

You have to get the current month from the Today() function, then display the name of previous month :

 

Previous month = FORMAT(DATE("2000";MONTH(TODAY())-1;"01");"mmmm")

 

It works for all month, I checked January 😉

Highlighted
Frequent Visitor

Re: PreviousMonth Name to Display in Texbox

Hello.

 

You can do this by creating an empty Query.

 

Go to Edit Query --> New Source --> Blank Query --> Paste the following code into the field --> name your Query (Should be Query1 by default).

 

= Text.Proper(Date.MonthName((Date.AddMonths(DateTime.Date(DateTime.LocalNow()), -1))))

bild.png

 

Now you sould see a field named "Previuos Month" with previous months name.

Highlighted
Anonymous
Not applicable

Re: PreviousMonth Name to Display in Texbox

Hi Thanks Remi,

 

this works fine but thing is i would like to add this as a Dynamic text into my text box.

so i created this (Previous month = FORMAT(DATE("2000";MONTH(TODAY())-1;"01");"mmmm") as mesure 

and tried to put in text box but it is not taking,but when i keep in Card it is working.

 

my actual requirement is to Display "January2017 Month Leaves" bold text along other text i want display in text box.

 

my query here is Can't we Display Measure along some Static Text in Text box.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: PreviousMonth Name to Display in Texbox

Hi @Anonymous,

 

As you know, textbox only supports static text content, we are not allowed to add a measure into it.

 

To work around your requirement, you can append the static text to the dynamic Month value in measure and display it in Card visual. However, the limitation is that we cannot set "January2017" and "Month Leaves" to different font formats.

The measure could be:
Previous month = FORMAT(DATE("2000";MONTH(TODAY())-1;"01");"mmmm") & " Month Leaves"

 

Alternatively, you can use a Card to display dynamic Month value and use Text box to display static text. Adjust the position of Card to make it locate inside the Textbox so that the text looks like a entirety.

2.PNG

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
New Member

Re: PreviousMonth Name to Display in Texbox

Another more flexible way of doing it

 

Previous Month = FORMAT(EOMONTH(NOW(),-1),"MMMM YYYY")
 
this way you can format it any way you want

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors