Forum Discussion
Assistance Needed with DAX URL Construction for Child Report Navigation
- 1 year ago
Hi Anonymous ,
You're encountering an issue because the logic in your DAX formula for building the URL is backwards—you’re telling it to include a filter when the value is blank, which is the opposite of what you want. For example, this line:
VAR EquipFilter = IF(ISBLANK(EquipValue), " and qms_tij2x_stage_data/equip_nm eq '" & EquipValue & "'", "")tries to insert a blank value into the URL when the equipment name is empty. That’s going to break the URL or make it filter incorrectly. Instead, you want to include the filter only if the value is present. To fix that, you should reverse the condition and write:
VAR EquipFilter = IF(NOT ISBLANK(EquipValue), " and qms_tij2x_stage_data/equip_nm eq '" & EquipValue & "'", "")Repeat this pattern for all your other filters: check that the value is not blank before including the filter. This way, the URL will only contain valid filters based on available row context, and will skip over any fields that are blank—making the navigation from the main report to the child report reliable and clean. If you also have values with special characters (like spaces, slashes, or ampersands), you might eventually need to handle URL encoding, but for now, fixing the logic for blanks will resolve your immediate problem.
Best regards,
- 1 year ago
Hi Anonymous,
The issue seems to be that the EquipValue is not being evaluated as truly blank, which can cause the filter to be added incorrectly. Even when using ISBLANK, if the value contains whitespace or unprintable characters, the check will fail. A more reliable approach is to use TRIM and explicitly compare against an empty string.
Update your EquipFilter logic as follows:
VAR CleanEquipValue = TRIM(EquipValue) VAR EquipFilter = IF( NOT ISBLANK(CleanEquipValue) && CleanEquipValue <> "", " and qms_tij2x_stage_data/equip_nm eq '" & ENCODEURL(CleanEquipValue) & "'", "" )This trims any extra spaces and ensures that only non-empty, non-null values are included. Repeat the same pattern for any other filters where similar issues may occur. Let me know if the issue still persists after this update.
Best regards,
Hi DataNinja777 , pankajnamekar25 ,
I tried with that logic but still facing the same issue.
Could you please help me with this to resolve the issue.
Thanks in advance!
Hi Anonymous,
The issue seems to be that the EquipValue is not being evaluated as truly blank, which can cause the filter to be added incorrectly. Even when using ISBLANK, if the value contains whitespace or unprintable characters, the check will fail. A more reliable approach is to use TRIM and explicitly compare against an empty string.
Update your EquipFilter logic as follows:
VAR CleanEquipValue = TRIM(EquipValue)
VAR EquipFilter =
IF(
NOT ISBLANK(CleanEquipValue) && CleanEquipValue <> "",
" and qms_tij2x_stage_data/equip_nm eq '" & ENCODEURL(CleanEquipValue) & "'",
""
)
This trims any extra spaces and ensures that only non-empty, non-null values are included. Repeat the same pattern for any other filters where similar issues may occur. Let me know if the issue still persists after this update.
Best regards,