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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alianazambori
Frequent Visitor

Filter a report using query string parameters in the URL, the value is coming from a Date Hierarchy

Hello,

 

I need to build in a URL a filter by Month when the Month is coming from a Date column/ Date Hierarchy. Here is a screenshot of the slicer and I have to pass the month of July for example in the URL:

alianazambori_0-1649246198692.jpeg

Table Name: Dates

Column Name: Date

Hierarchy name: Date Hierarchy

Filter criteria from Hierarchy: Month

Example for filter value: July

 

This is what I am trying to achieve: PBI_link_with_any_filter&filter=Dates%2FMonth%20eq%20%27July%27 (this part that it is in bold I don't know how to build it).

Thank you

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @alianazambori ,

 

Because the date hierarchy is derived from a hidden table in the model, you cannot refer to it directly in the query parameters using Date.Month. You need to use SSMS/DAX Studio to find that hidden table name and then filter it, for example: ?filter=LocalDateTable_67609027-3022-4eea-905a-9c089f72e640%2FMonth%20eq%20%27July%27 

Screenshot 2022-04-11 103131.png

vkkfmsft_0-1649644868368.png

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

4 REPLIES 4
alianazambori
Frequent Visitor

Hi,

 

To identify that hidden table I was using the Vertipaq Analyzer (might be another solution too). So I added in External Tools the tool called DAX Studio 

alianazambori_0-1654089482579.png

then I used Vertipaq Analyzer: https://www.sqlbi.com/tools/vertipaq-analyzer/ with the guide on how to do it further here: https://www.sqlbi.com/articles/data-model-size-with-vertipaq-analyzer/

You will see following the instruction that an .xlsm file will be generated:

alianazambori_1-1654089609335.png

Inside this file, you will find how the Date table is called. In the Tables Tab (first tab) you will have something similar to this: DateTableTemplate_c0dbb16f-5245-4b73-91ce-cca98ae74a08

So in your linked you'll be using: &filter=DateTableTemplate_c0dbb16f-5245-4b73-91ce-cca98ae74a08%2FMonth%20eq%20%27July%27

Regards, 

Liana

alianazambori
Frequent Visitor

Thank you! The solution works perfectly.

v-kkf-msft
Community Support
Community Support

Hi @alianazambori ,

 

Because the date hierarchy is derived from a hidden table in the model, you cannot refer to it directly in the query parameters using Date.Month. You need to use SSMS/DAX Studio to find that hidden table name and then filter it, for example: ?filter=LocalDateTable_67609027-3022-4eea-905a-9c089f72e640%2FMonth%20eq%20%27July%27 

Screenshot 2022-04-11 103131.png

vkkfmsft_0-1649644868368.png

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I have a very similar issue, below is a screenshot of the slicer and I could not find any hidden tables

AdityaSridhar_0-1654087675007.png

But the Date Dimension table has been created using the below logic:

Date Dimension =

ADDCOLUMNS (

CALENDAR (MIN('Fact table'[date]), MAX('Fact table'[date])),

"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),

"Year", YEAR ( [Date] ),

"Monthnumber", FORMAT ( [Date], "MM" ),

"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),

"YearMonthDatenumber", FORMAT ( [Date], "YYYY/MM/DD" ),

"YearMonthShort", FORMAT ( [Date], "MMM-YY" ),

"MonthNameShort", FORMAT ( [Date], "mmm" ),

"MonthNameLong", FORMAT ( [Date], "mmmm" ),

"WeekNumber", WEEKNUM([Date], 2),

"DayOfWeekNumber", WEEKDAY ( [Date] ),

"DayOfWeek", FORMAT ( [Date], "dddd" ),

"DayOfWeekShort", FORMAT ( [Date], "ddd" ),

"Quarter", "Q" & FORMAT ( [Date], "Q" ),

"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ))

 

Could you help with my issue, thanks is advance

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors