Forum Discussion

kaym's avatar
kaym
Helper I
1 year ago
Solved

How to include YEAR filter in URL?

Hello, I have this as my calendar table: Calendar = ADDCOLUMNS(     CALENDAR(MIN('API_Data'[ProductionDate]), MAX('API_Data'[ProductionDate])),     "Week", "WEEK " & WEEKNUM([Date]),   ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,lbendlin ,thanks for your concern about this issue.

    Your answer is excellent!
    And I would like to share some additional solutions below.
    Hi,kaym .I am glad to help you.
    In fact I think you could create an additional calculated column [Year] as suggested by lbendlin (to create a numeric/text type)
    Filter URLs using calculated column =2023

    URL:
    Filter a Power BI report passing parameters through URL | LazySnail
     

    2. Use the original data field you use for filtering (Date/DateTime Type)
    The documentation mentions that there are some limitations when you use the date type data field for URL filtering.

    Filter a report using query string parameters in the URL - Power BI | Microsoft Learn

    I hope you find the link below helpful:
    URL:

    Solved: Salesforce URL to Open and Filter Power BI Report ... - Microsoft Fabric Community

     

    This is my test.

    Note that special characters in the URL, such as quotes and spaces, need to be escaped.


    URL :Filter meausre code

    JumpURL = 
    "https://app.powerbi.com/groups/xxxYourGroupIDxxx/reports/2825de85-adf5-4e84-bd8b-ea0514420a29/eba9e747ea0da7e5db78?filter=datarefreshTest%2Fanimal%20eq%20%27"&[SelectAnimal]&"%27"
    


    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Poojara_D12's avatar
    1 year ago

    Hi kaym 

    To filter your Power BI report by year, use a date range in the URL filter. For 2023, the format is:

     

    &filter=Calendar/Date ge 2023-01-01T00:00:00Z and Calendar/Date lt 2024-01-01T00:00:00Z

     

    This filters dates between January 1, 2023, and December 31, 2023.

    Ensure the table and field names (Calendar and Date) match exactly as they appear in your Power BI dataset.

    Use UTC timestamps (T00:00:00Z) to avoid timezone-related issues.

     

    Did I answer your question? Mark my post as a solution, this will help others!

    If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

    Kind Regards,
    Poojara
    Data Analyst | MSBI Developer | Power BI Consultant
    Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS