Forum Discussion

AliceTran1643's avatar
AliceTran1643
Frequent Visitor
8 months ago
Solved

How to set Date Parameters to show data between 2 dates selected from 1 date column

Hello, 

I wanted to set up a parameter for users to select a date range and generate a report showing data in between the selected dates. I have looked up videos/previous posts about this and all suggested to create a "start date" and "end date" for users to select. However, I am having a problem connected those parameter to my dataset since the dataset only has a "entry date" column. I found some posts suggested to code a condition in query designer which is not an option since my data is from Sharepoint List. Please let me know how to get this to work. 

 

TYSM! 

  • 1) Create two parameters

    • @StartDate (Date/Time)

    • @EndDate (Date/Time)

    Set:

    • Data type = Date/Time

    • Allow null = No (or give defaults)

    2) Filter the dataset on the single date column

    Your dataset already has EntryDate — that’s enough.

    In the dataset query filter (or WHERE clause equivalent):

    WHERE EntryDate >= @StartDate
      AND EntryDate <= @EndDate

    3) If using the Dataset Filters (no SQL)

    If your SharePoint List dataset doesn’t expose SQL:

    • Open Dataset Properties

    • Go to Filters

    • Add:

      • Expression: =Fields!EntryDate.Value

      • Operator: >=

      • Value: =Parameters!StartDate.Value

    • Add another filter:

      • Operator: <=

      • Value: =Parameters!EndDate.Value

11 Replies

  • Hi AliceTran1643,

     

    what about just using the slicer visual, put in your date column and set the option to "between"? Then the user can select the start and end date directly on the slicer. 

    Best regards!

    PS: if this helps, leave kudos and mark it as solution. 

  • Hi AliceTran1643 if you use date column in a slicer, then you should by default (style should be between) a date selection option appears. Please make sure your date column is in date format, i.e. data type is date.

     

    If this helps to resolve your problem, then mark it as solution.

     

    Thanks- Samrat

     

     

  • Hi AliceTran1643 

    If by query designer, you mean power query/query editor you should still be able to create transformations that suit your need although I am unsure what you really want to achieve. And as what other users have already mentioned, if you're trying to choose a date range, why not just use the date slicer? Otherwise, please provide more context to your post, a sample data and your expected result from the same.

  • You don’t actually need parameters for this in Power BI — that approach is more common in paginated reports or SQL-based tools. In Power BI reports, the native and best practice solution is to use a date slicer.

     

    Since you already have a single date column (Entry Date), just place it in a slicer and change the slicer type to Between. This automatically gives users a start and end date selector, and Power BI will filter all visuals to show data between those two dates. No extra columns, no query changes, and it works perfectly with SharePoint lists.

  • How to let users select a date range in Power BI (SharePoint data)

    1. Create a Date table in Power BI (using DAX).
      This table will contain a list of dates.
    2. Link the Date table to your data
      Create a relationship between
      DateTable[Date] → YourList[Entry Date]
    3. Add a Date slicer to the report
      Use DateTable[Date] in a slicer and set it to Between.
    4. Users pick start and end dates
      The report automatically shows only records where
      Entry Date falls between the selected dates.

    Key thing to remember

    You do not need start or end date columns in your dataset.
    A single Entry Date column is enough.

    This approach works perfectly with SharePoint Lists and does not require Query Designer or Power Query parameters.


  • Hi Alice,

    You do not need to create separate Start Date and End Date columns in your dataset. Since you already have one date column (Entry Date), Power BI can handle this directly.

    i can provide you two ways to do it....

    1st method : ##Easiest and Recommended Way (No Parameters Needed)
    Use a Date Slicer instead of parameters.

    Steps:

    • Add your report visual (table, chart, etc.)
    • Add a Slicer visual
    • Drag Entry Date into the slicer
    • Change the slicer type to “Between”
    • Select the From Date and To Date

    All visuals will automatically show data between the selected dates.

    This works perfectly with SharePoint List data and does not require Query Designer or any coding.


    2nd method : ###Using Parameters (Advanced)

    Only use this if parameters are mandatory.

    • Create two parameters:

    Start Date

    End Date

    • Create a DAX measure: 
      Show Data = IF (SELECTEDVALUE ( Table[Entry Date] ) >= [Start Date Parameter] && SELECTEDVALUE ( Table[Entry Date] ) <= [End Date Parameter], 1, 0)

    Apply this measure as a visual-level filter (Show Data = 1)

    This approach is more complex and usually not required.

    Best tips i can give is : Use a Date Slicer., It is simple for users, requires no Power Query or SQL, and works well with SharePoint Lists.

    • cengizhanarslan's avatar
      cengizhanarslan
      Super User

      1) Create two parameters

      • @StartDate (Date/Time)

      • @EndDate (Date/Time)

      Set:

      • Data type = Date/Time

      • Allow null = No (or give defaults)

      2) Filter the dataset on the single date column

      Your dataset already has EntryDate — that’s enough.

      In the dataset query filter (or WHERE clause equivalent):

      WHERE EntryDate >= @StartDate
        AND EntryDate <= @EndDate

      3) If using the Dataset Filters (no SQL)

      If your SharePoint List dataset doesn’t expose SQL:

      • Open Dataset Properties

      • Go to Filters

      • Add:

        • Expression: =Fields!EntryDate.Value

        • Operator: >=

        • Value: =Parameters!StartDate.Value

      • Add another filter:

        • Operator: <=

        • Value: =Parameters!EndDate.Value

  • v-priyankata's avatar
    v-priyankata
    Community Support

    Hi AliceTran1643  , Thank you for reaching out to the Microsoft Community Forum.

    Thank you danextian cengizhanarslan praveen_511 Murtaza_Ghafoor for your valuable responses.

    All users answered correctly but now since you stated that this is a paginated report created in Report Builder, the correct way to let users select a date range is by using report parameters. Paginated reports do not support slicers or interactive filtering after the data is loaded, so filtering must happen when the dataset runs.

    You only need your existing Entry Date column from the SharePoint List. Create two report parameters, a Start Date and an End Date and apply them as filters on the dataset so that Entry Date is greater than or equal to the start date and less than or equal to the end date.

    When the report is run, users will be prompted to enter the date range and the dataset will return only the records where Entry Date falls within that range. This is the standard and supported pattern for date range filtering in paginated reports using SharePoint data.



    Thanks.

    • v-priyankata's avatar
      v-priyankata
      Community Support

      Hi AliceTran1643 

      Thank you for reaching out to the Microsoft Fabric Forum Community.

       

      I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.

       

      • v-priyankata's avatar
        v-priyankata
        Community Support

        Hi AliceTran1643 

        Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.