Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kaym
Helper I
Helper I

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]),
    "Weekday", FORMAT([Date], "ddd"),
    "YearMonth", FORMAT([Date], "YYYY-MM"),
    "YearMonthSort", YEAR([Date]) * 100 + MONTH([Date])
)

I need to have a URL for filtering by YEAR (say 2023). How do i do that? What is the format for the filter portion of the URL when it comes to a DATE?

For example, I used this for a different field and it wokred perfectly:
https://app.powerbi.com/groups/17f****************************c8/reports/a7*************************...&filter=API_Data/WorkCenter eq 'Jacketing'

but it does not work for year


2 ACCEPTED SOLUTIONS
v-jtian-msft
Community Support
Community Support

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
 

vjtianmsft_0-1734922951422.png

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

vjtianmsft_1-1734922985529.png

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.

vjtianmsft_2-1734923060648.png

vjtianmsft_3-1734923070773.png
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.

View solution in original post

Poojara_D12
Memorable Member
Memorable Member

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 

View solution in original post

5 REPLIES 5
Poojara_D12
Memorable Member
Memorable Member

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 

v-jtian-msft
Community Support
Community Support

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
 

vjtianmsft_0-1734922951422.png

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

vjtianmsft_1-1734922985529.png

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.

vjtianmsft_2-1734923060648.png

vjtianmsft_3-1734923070773.png
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.

lbendlin
Super User
Super User

You need to add a Year column first.  Then the filter will be Calendar/Year eq 2023

Hi @lbendlin ,

I tried that but that did not work either

show your work.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.