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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

How to add custom text in dropdown menu (for latest date)

I am trying to add a text like "Current = " for the latest date.

Bottom is illustration:

This is what I have, but I would like to modify so that it shows up as 

"Current = May 2024"  instead of "May 2024"

 

JustinDoh1_0-1717613225009.png

 

Basically, the data gets populated from SQL like this:

JustinDoh1_1-1717613396228.png

Do I have to create an extra column in SQL with a logic to add "Current =" (for latest date), and somehow add with the Processind Date data? 

 

But, how to concatenate with text data (Current = ) with Date/time data?

Currently, ProcessingDate column is "Date/time" data type.

JustinDoh1_2-1717613684365.png

 

I guess, I might be create a SQL View to concatenate two columns, and convert both columns into a text column possilby.

But, I would like to get some feedback if there is a way to do it in PBI. 

 

 

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@JustinDoh1 Well you can add a duplicate column in Power BI but if you can add it at the backend, it is better. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Anonymous
Not applicable

Hi,@JustinDoh1 .I am glad to help you.
Hello,@parry2k .thanks for your concern about this issue.

Your answer is excellent! And I would like to share some additional solutions below.

According to your description, you want to modify the date column in the table: when the date value is current month, display it as "current=today()", change the date type to text type and add it in the slicer options.

If my understanding is correct

You can refer to my test result below

You can do this by creating a new calculated column in Desktop.
Here is my test data:

vjtianmsft_0-1718884886375.png

I created a new column C_result to format the date column data

 

 

C_result = 
IF(MONTH('Table_'[Processing Date])=MONTH(TODAY())&&YEAR('Table_'[Processing Date])=YEAR(TODAY()),
"Current="&[Processing Date],
""&[Processing Date]
)

 

 

vjtianmsft_1-1718884919276.png

This allows you to filter the data directly through the newly created C_result column as a slicer.

sugestion2: But this filtering is very limited because the data type is text.

So I suggest you can modify the filtering range by creating a measure that tags the data.

like this

I created a new date table as a formatted slicer option.

vjtianmsft_2-1718884958972.png

 

 

Table_slicer = VALUES('Table_'[C_result])

 

 

Create M_result to sift through the data

 

 

M_result = 
VAR selectedValue_=MAX('Table_slicer'[C_result])
VAR datevalue_=
IF(CONTAINSSTRING(selectedValue_,"Current"),
    DATEVALUE(RIGHT(selectedValue_,8)),
    DATEVALUE(selectedValue_)
)
RETURN
IF(MAX('Table_'[Processing Date])<=datevalue_,
1,0)

 

 

Add M_result=1 as a filter condition to visual
Implemented slicer to return data for a month and previous months when selecting a particular month's date

vjtianmsft_5-1718885337191.png

 

vjtianmsft_3-1718885062557.pngvjtianmsft_4-1718885107265.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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
Anonymous
Not applicable

Hi,@JustinDoh1 .
Has your problem been solved? If you have found suitable solutions, please share them as it will help more users with similar problems.
Or you can mark the valid suggestions provided by other users as solutions.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi,@JustinDoh1 .I am glad to help you.
Hello,@parry2k .thanks for your concern about this issue.

Your answer is excellent! And I would like to share some additional solutions below.

According to your description, you want to modify the date column in the table: when the date value is current month, display it as "current=today()", change the date type to text type and add it in the slicer options.

If my understanding is correct

You can refer to my test result below

You can do this by creating a new calculated column in Desktop.
Here is my test data:

vjtianmsft_0-1718884886375.png

I created a new column C_result to format the date column data

 

 

C_result = 
IF(MONTH('Table_'[Processing Date])=MONTH(TODAY())&&YEAR('Table_'[Processing Date])=YEAR(TODAY()),
"Current="&[Processing Date],
""&[Processing Date]
)

 

 

vjtianmsft_1-1718884919276.png

This allows you to filter the data directly through the newly created C_result column as a slicer.

sugestion2: But this filtering is very limited because the data type is text.

So I suggest you can modify the filtering range by creating a measure that tags the data.

like this

I created a new date table as a formatted slicer option.

vjtianmsft_2-1718884958972.png

 

 

Table_slicer = VALUES('Table_'[C_result])

 

 

Create M_result to sift through the data

 

 

M_result = 
VAR selectedValue_=MAX('Table_slicer'[C_result])
VAR datevalue_=
IF(CONTAINSSTRING(selectedValue_,"Current"),
    DATEVALUE(RIGHT(selectedValue_,8)),
    DATEVALUE(selectedValue_)
)
RETURN
IF(MAX('Table_'[Processing Date])<=datevalue_,
1,0)

 

 

Add M_result=1 as a filter condition to visual
Implemented slicer to return data for a month and previous months when selecting a particular month's date

vjtianmsft_5-1718885337191.png

 

vjtianmsft_3-1718885062557.pngvjtianmsft_4-1718885107265.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



parry2k
Super User
Super User

@JustinDoh1 Well you can add a duplicate column in Power BI but if you can add it at the backend, it is better. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@JustinDoh1 yes, better to add another column in the SQL and have this column sorted by the original column so that it shows up in the correct order otherwise it will be alphabetically sorted because it will become a text column.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k So, there is no solution in PBI file itself to add something like this, right?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.