Forum Discussion
Show days before the selected date
- 5 years ago
Hi Anonymous ,
To achieve the simliar result from the viedo, you need to create what-if parameter first:
It will produce a table with a column, a measure and a slicer which includes the column, just rename them to show the number:
Then you need a separate date table and use it as another slicer, if your source table has already had date columns, you can use CALENDARAUTO(), DISTINCT() to create it.
Create a Date selected measure:
Date selected = SELECTEDVALUE('Date'[Date])Create a total measure like this and put it in the bar chart:
Total = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Date] <= SELECTEDVALUE ( 'Date'[Date] ) && 'Table'[Date] >= SELECTEDVALUE ( 'Date'[Date] ) - [Day Number] ) )Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
To achieve the simliar result from the viedo, you need to create what-if parameter first:
It will produce a table with a column, a measure and a slicer which includes the column, just rename them to show the number:
Then you need a separate date table and use it as another slicer, if your source table has already had date columns, you can use CALENDARAUTO(), DISTINCT() to create it.
Create a Date selected measure:
Date selected = SELECTEDVALUE('Date'[Date])
Create a total measure like this and put it in the bar chart:
Total =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Date] <= SELECTEDVALUE ( 'Date'[Date] )
&& 'Table'[Date]
>= SELECTEDVALUE ( 'Date'[Date] ) - [Day Number]
)
)
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dude I can't thank you enough. Thank you so much !!