Forum Discussion
Dynamic Slicers with 2 dates
- 2 years ago
Hi, johnbasha33
You need to drop one of the columns of end date or start date and store it in a table of calculations and put it into the slicer as shown in the following figure:
End day table = SUMMARIZE('Table','Table'[End Date])I created the following two metrics:
share price of end date = VAR _end_day = SELECTEDVALUE('End day table'[End Date]) RETURN CALCULATE(SUM('Table'[Share Price]),FILTER(ALL('Table'),'Table'[End Date]=_end_day))share price of start date = VAR _start_day = SELECTEDVALUE('Table'[Start Date]) RETURN CALCULATE(SUM('Table'[Share Price]),FILTER( ALL('Table'), 'Table'[Start Date]=_start_day ) )I use both metrics in the table visual:
The results are as follows:
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 2 years ago
Hi,
You can unpivot Start date and end date columns, so you will get values column in which all dates will be stored ,
now you can use values column in between slicer and get share price from date range
Could give us an example of what do you need in your visual and in which visual?
- Arul2 years ago
Super User
Do you want them in two visuals?
- johnbasha332 years ago
Super User
Arul no, in a single visual with 2 columns, share price of start date and share price of end date
- hackcrr2 years ago
Memorable Member
Hi, johnbasha33
You need to drop one of the columns of end date or start date and store it in a table of calculations and put it into the slicer as shown in the following figure:
End day table = SUMMARIZE('Table','Table'[End Date])I created the following two metrics:
share price of end date = VAR _end_day = SELECTEDVALUE('End day table'[End Date]) RETURN CALCULATE(SUM('Table'[Share Price]),FILTER(ALL('Table'),'Table'[End Date]=_end_day))share price of start date = VAR _start_day = SELECTEDVALUE('Table'[Start Date]) RETURN CALCULATE(SUM('Table'[Share Price]),FILTER( ALL('Table'), 'Table'[Start Date]=_start_day ) )I use both metrics in the table visual:
The results are as follows:
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.