Forum Discussion
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)
When i use the default slicer, I get the correct values, but the dates are incorrect.
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
- amitchandakSuper User
milodinosaur , refer if this approach can help
Power BI Abstract Thesis: How to use two Date/Period slicers
- milodinosaurFrequent Visitor
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?