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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
NoneOR
Regular Visitor

Custom RSCustomDaxFilter

Hello in report builder i have a need to modify rscustomfilter

 

 

 

// DAX Query
DEFINE
	VAR __DS0FilterTable = 
		RSCustomDaxFilter(@x1,EqualToCondition,[x1].[x1],String)

	VAR __DS1FilterTable = 
		RSCustomDaxFilter(@x2,EqualToCondition,[x2].[[x2]],String)

	VAR __DS0Core = xxx

 

 

 

Normally i ve done 'if' statement in var __ds0core but also there is need to assign same if in __DS1FilterTable which is using original source and ds0core var is showing transformed output as table view. I need to use transformed parameter in report builder, Its a little harder to modify ds1filter var. 

 

The aim is to modify it with if and make RSCustomDaxFilter rs1 to use if variable

 

    IF(
        ISBLANK('DIM_x1'[x1]), 
        "-", 
        'DIM_x2'[x2]
    )

 

3 REPLIES 3
NoneOR
Regular Visitor

ref

NoneOR
Regular Visitor

@DataNinja777  There is an issue with var placement. It works with original path, but when i replace column path with variable it returns error

NoneOR_0-1740825954903.png

NoneOR_1-1740826125263.png

 

DataNinja777
Super User
Super User

Hi @NoneOR ,

 

To modify __DS1FilterTable in Report Builder using the IF condition, the transformation needs to be integrated into RSCustomDaxFilter while ensuring that it correctly references the adjusted value. The IF condition should evaluate whether DIM_x1[x1] is blank and return "-" if true, otherwise it should return DIM_x2[x2]. This logic can be applied directly within RSCustomDaxFilter, but depending on Report Builder's behavior, it may require defining the transformation as a separate variable before applying it to the filter.

DEFINE
    VAR __DS0FilterTable = 
        RSCustomDaxFilter(@x1, EqualToCondition, [x1].[x1], String)

    VAR __DS1FilterTable =
        RSCustomDaxFilter(
            IF(
                ISBLANK('DIM_x1'[x1]), 
                "-", 
                'DIM_x2'[x2]
            ),
            EqualToCondition,
            [x2].[x2], 
            String
        )

    VAR __DS0Core = xxx

If RSCustomDaxFilter does not accept the inline IF condition, defining a separate transformation variable first and then passing it to the filter might be necessary:

DEFINE
    VAR __DS0FilterTable = 
        RSCustomDaxFilter(@x1, EqualToCondition, [x1].[x1], String)

    VAR __TransformedX2 =
        IF(
            ISBLANK('DIM_x1'[x1]), 
            "-", 
            'DIM_x2'[x2]
        )
    
    VAR __DS1FilterTable =
        RSCustomDaxFilter(@x2, EqualToCondition, __TransformedX2, String)

    VAR __DS0Core = xxx

This ensures that __DS1FilterTable uses the transformed value properly while maintaining Report Builder’s requirements for parameter usage. Let me know if any adjustments are needed based on how Report Builder processes these conditions.

 

Best regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.