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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sedkimic
Frequent Visitor

RSCustomDaxFilter Documentation

Is there documentation anywhere on the RSCustomDaxFilter function used in Report Builder?  Specifically, I'm interested in what (if any) other accepable options are for the second parameter besides EqualToCondition.  Is there a "greater than or equal to option"?

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi again,

I did get this working yesterday, but today tried to retrace my steps and realised I'd forgotten some of the fiddly details, so just replying now 😅

 

In short, yes, you should create a query parameter and set its value to that of the existing report parameter (in Dataset Properties > Parameters).

Also, you should avoid Query Designer (in my experience).

 

For completeness, the full set of steps I followed:

  1. Create a new Dataset
  2. In the Dataset Properties dialog box, in Parameters section, click Add.
  3. Enter Parameter Name
    This can be the same name or a different name from the existing report parameter, as it is scoped to the query.
  4. For Parameter Value, select the existing report parameter from the dropdown.
  5. Go to Query section of Dataset Properties dialog box.
  6. Specify Name & Data source
  7. Don't click Query Designer. Enter or paste DAX query into Query dialog box, incorporating the query parameter defined above.
  8. Click Validate Query to confirm it works, then OK.

I have to give credit to this Reddit comment where the author followed similar steps.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

5 REPLIES 5
OwenAuger
Super User
Super User

Hi again,

I did get this working yesterday, but today tried to retrace my steps and realised I'd forgotten some of the fiddly details, so just replying now 😅

 

In short, yes, you should create a query parameter and set its value to that of the existing report parameter (in Dataset Properties > Parameters).

Also, you should avoid Query Designer (in my experience).

 

For completeness, the full set of steps I followed:

  1. Create a new Dataset
  2. In the Dataset Properties dialog box, in Parameters section, click Add.
  3. Enter Parameter Name
    This can be the same name or a different name from the existing report parameter, as it is scoped to the query.
  4. For Parameter Value, select the existing report parameter from the dropdown.
  5. Go to Query section of Dataset Properties dialog box.
  6. Specify Name & Data source
  7. Don't click Query Designer. Enter or paste DAX query into Query dialog box, incorporating the query parameter defined above.
  8. Click Validate Query to confirm it works, then OK.

I have to give credit to this Reddit comment where the author followed similar steps.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

That did it.  Thanks for the steps.  This doesn't seem to be documented well by Microsoft.

OwenAuger
Super User
Super User

@sedkimic 

I have not been able to find the official documentation on RSCustomDaxFilter 😞

 

However, based on this article, it appears that the only possible conditions for RSCustomDaxFilter are:

  • EqualToCondition
  • NotEqualToCondition

But if you have a single-valued parameter that you are using as the lower-bound of a filter, then you can use syntax like this in the Report Builder DAX query:

MyTable[MyColumn] >= @MyParameter

This assumes "MyParameter" is configured correctly and the type corresponds to MyColumn etc.

 

Regards,

Owen 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Additionally, RSCustomDaxFilter for multi-value parameters is essentially syntactic sugar for this FILTER pattern:

 

    FILTER( 
        VALUES('MyTable'[Filter Column]), 
        PATHCONTAINS(@MyParameter, 'MyTable'[Filter Column])
    ), 

 

as long as you first change the dataset parameter to be a string that joins the parameter array items using the pipe character:

 

=join(Parameters!MyParameter.Value, "|")

and once you have the DAX you can change it as needed. 

 

This is what I tried based on your suggestion where @CalendarEndofMonth matches a report parameter that had been previously defined and is being used by other datasets in the report.  When validating the query I receive an error message that contains "The query contains the 'CalendarEndofMonth' parameter, which is not declared."  Does the parameter have to be declared in the query as well?  And if so, how?

 

This does return the expected result within DAX Studio.

 

EVALUATE
SUMMARIZECOLUMNS (
    'Calendar'[End of Month],
    FILTER (
        VALUES ( 'Calendar'[End of Month] ),
        ( 'Calendar'[End of Month] >= @CalendarEndofMonth )
    ),
    "5 Year Treasury Yield", [5 Year Treasury Yield]
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors