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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
milodinosaur
Frequent Visitor

Comparison tool tip not dynamic with different date range

Hi all, I have 2 slicers that allows me to choose different date ranges to make comparison and I have superimposed them to start at the same point despite having different date ranges. However, I am facing some troubles with my tooltip. Only the left hand side's slicer's value is being updated and changing, whereas the right hand side's slicer's value is not changing on my tool tip. (Check the table above for the desired value & date)

milodinosaur_1-1689913242135.png

When i use the default slicer, I get the correct values, but the dates are incorrect. 

milodinosaur_2-1689913350910.png

Any ideas how to fix this? 

Another problem I face (but not as pressing) is that the end date of my graph follows the left hand side slicer. (ie. even though there are 171 days selected for the right side slicer, only 145 days are shown according to the left side slicer. 

Would appreciate any help possible! 

 

Here's my DAX code for the comparison line (ie the line generated by the right side slicer)
ComparisonLine =
VAR __thisdate = SELECTEDVALUE ( 'DATE TABLE 1'[Date] )
VAR __minslicer1 = CALCULATE ( MIN ( 'DATE TABLE 1'[Date] ), ALLSELECTED ( 'DATE TABLE 1'[Date] ) )
VAR __daysin = DATEDIFF ( __minslicer1, __thisdate, DAY ) + 0
VAR __minslicer2 = CALCULATE ( MIN ( 'Date Table (2)'[Date] ), ALLSELECTED ( 'Date Table (2)'[Date] ) )
VAR __prevdate = __minslicer2 + __daysin

RETURN CALCULATE ( [Total], 'DATE TABLE 1'[Date] = __prevdate )
2 REPLIES 2
amitchandak
Super User
Super User

@milodinosaur , refer if this approach can help

 

Power BI Abstract Thesis: How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

Hi @amitchandak !

Thank you for the wonderful video, however, I am trying to achieve slightly more than what is shown in the video, which is shifting the start date of the later date range, to make them start at the same point in my line chart. That I've succeeded, however, now the problem is with the tool tip not changing accordingly, since the x-axis of the graph is only using the first calendar table, and not the other. 

Do you have any ideas how to fix it? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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