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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Shrujan1612
Frequent Visitor

Need to create date sort meaure for toll tip

Based on the client requirement, created measure to show last three months data based on slicer selection, now we need to show the monthenddate in the tool tip for all the month which data as been shown.

Date sort 3months = 

var mindate = Date(Year(calendar(Monthenddate),Month(calendar(Monthenddate)-2,Day(calendar(Monthenddate)))

var Result = if(Max(Monthenddate) < mindate,blank(), max(Monthenddate))

Return Result

By using above measure, we can achieve only latest month date in tool tip, but i want for previous 2 month also.

Example: if I select Jan 2023 in slicer, in visual it shows Nov, Dec and Jan data. So, we need achieve as menctioned above.

 

Can anyone help me in this?

 

Thanks in advance!

5 REPLIES 5
pranit828
Community Champion
Community Champion

Hi @Shrujan1612 ,
It would help if you can provide a sample data and the result you are expecxting. From what I can understand, try the below code

var mindate = Date(Year(calendar(Monthenddate),Month(calendar(Monthenddate)-2,Day(calendar(Monthenddate)))
var Result_curr   = if(Max(Monthenddate) < mindate,blank(), max(Monthenddate))
var Result_curr-1 = DATEADD ([Result_curr], -1, MONTH)
var Result_curr-2 = DATEADD ([Result_curr], -2, MONTH)
Return Result_curr & "-" & Result_curr-1 & "-" & Result_curr-2

 or create a tooltip page and use a table in to display. 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

It didn't work, when i hover on bar particular month date should be shown in tool tip for all three months

Sahir_Maharaj
Super User
Super User

This will return a string of 3 dates separated by ";". The first date is the latest 3rd month end date, the second date is the latest 2nd month end date, and the third date is the latest month end date. You can then use this string in the tool tip to display the month end dates.

 

Let me know if you require further assistance.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Sahir_Maharaj
Super User
Super User

Hello @Shrujan1612,

 

You can modify the measure as follows to show the latest 3 month end dates in the tool tip:

var mindate = Date(Year(calendar(Monthenddate)), Month(calendar(Monthenddate))-2, Day(calendar(Monthenddate)))
var maxdate = max(Monthenddate)
var mindate2 = Date(Year(calendar(mindate)), Month(calendar(mindate))-1, Day(calendar(mindate)))
var maxdate2 = if(maxdate >= mindate2, mindate2, BLANK())
var mindate3 = Date(Year(calendar(mindate2)), Month(calendar(mindate2))-1, Day(calendar(mindate2)))
var maxdate3 = if(maxdate2 >= mindate3, mindate3, BLANK())

Return Concatenate(maxdate3, ";", maxdate2, ";", maxdate)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

It didn't work, when i hover on bar particular month date should be shown in tool tip for all three months

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.