Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Fixed start date, date slicer and variable end date

Hello everyone,

I am creating a date slicer in Power BI where the start date is fixed, and the end date is variable. The slicer should show data from the fixed start date until the selected end date. I am unable to do it. How can I do it?

Thanks, Regards

  • Anonymous's avatar
    Anonymous
    3 years ago

    hi Anonymous ,

    try below steps

    To create a date slicer in Power BI where the start date is fixed and the end date is variable, you can follow these steps:

    1. Create a table or a query in Power Query that contains the date range you want to use as a slicer. This table should have a column with all the dates within the desired range.

    2. In the Power BI report, go to the "Home" tab and click on "Enter Data" to create a new table manually.

    3. Enter the start date in the first row of the table. Make sure to format the date correctly.

    4. Add a new column to the table and use the following formula to generate the list of dates between the start date and the current date:

      mathematica
    1. = List.Dates([Start Date], Number.From(DateTime.LocalNow()) - Number.From([Start Date]), #duration(1,0,0,0))
    2. Close and apply the changes to the query. Rename the table to something meaningful like "Date Slicer" or "Date Range".

    3. Insert a slicer visual into your report. Select the "Date Slicer" table as the data source for the slicer.

    4. Customize the slicer by selecting the appropriate date column. You may also adjust the format and appearance of the slicer as per your preference.

    5. Now, when you interact with the slicer, it will show the data from the fixed start date until the selected end date.

    Remember to refresh the data in your Power BI report periodically to include the latest dates automatically.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    hi Anonymous ,

    try below steps

    To create a date slicer in Power BI where the start date is fixed and the end date is variable, you can follow these steps:

    1. Create a table or a query in Power Query that contains the date range you want to use as a slicer. This table should have a column with all the dates within the desired range.

    2. In the Power BI report, go to the "Home" tab and click on "Enter Data" to create a new table manually.

    3. Enter the start date in the first row of the table. Make sure to format the date correctly.

    4. Add a new column to the table and use the following formula to generate the list of dates between the start date and the current date:

      mathematica
    1. = List.Dates([Start Date], Number.From(DateTime.LocalNow()) - Number.From([Start Date]), #duration(1,0,0,0))
    2. Close and apply the changes to the query. Rename the table to something meaningful like "Date Slicer" or "Date Range".

    3. Insert a slicer visual into your report. Select the "Date Slicer" table as the data source for the slicer.

    4. Customize the slicer by selecting the appropriate date column. You may also adjust the format and appearance of the slicer as per your preference.

    5. Now, when you interact with the slicer, it will show the data from the fixed start date until the selected end date.

    Remember to refresh the data in your Power BI report periodically to include the latest dates automatically.