user19210181
user19210181

Reputation: 9

Paginated Report-Date Parameter Range

I am using Paginated Reports against a dataset published in the cloud. I click on Query Designer to drag all the columns to the page and build my query parameters (i.e, not report parameters). When I add my date parameter, I have options in the dropdown of 'equal to', 'not equal to', 'contains', 'begins with.', 'range(inclusive)', 'ange(exclusive)', and 'Custom'. I want the date parameter such that when the user selects a date in the parameter prompt, the query returns 13 months of data, ending on the date they select in the parameter, so if they select 10/31/22, the results will be 10/31/21 thru 10/31/22. I don't want the user to have to enter a start and end date range if I don't have to. Given the parametr options I have, I don't see how to do this. I thought about modifying the code of the resulting query statement (it begins with EVALUATESUMMARIZECOLUMNS). I see logic in the code that says 'RCustomDaxFilter(@Date,EqualtoCondition'. I thought about changing the 'EqualtoCondition' to something like 'Between', but nothing works. Thanks for any assistance!

Upvotes: 0

Views: 1347

Answers (1)

Chris
Chris

Reputation: 29

This request is a bit old but leaving here an answer maybe will help others.

In the query designer you could use the following expression:

> EVALUATE SUMMARIZECOLUMNS(
>     'table'[field1],
>     'table'[field2],
>     'table'[START_DT], 
>     'table'[END_DT],
>      FILTER(
>      VALUES('table'[END_DT]), 
>       @date_selector <= 'table'[END_DT]
>     ),
>     FILTER(
>      VALUES('table'[START_DT]), 
>       @date_selector >= 'table'[START_DT]
>     )
>     ) ORDER BY 
>     'table'[field1] ASC

Of course you need to customize it if you dont want the parameter. Mind you that these are query parameters. more details on types of paginated report param here.

Upvotes: 0

Related Questions