Forum Discussion
Issue with DAX Filter via Web URL
- 1 year ago
Hi CoderV9 ,
You are absolutely right - hardcoding values like 202501 or "WXYZ" inside the DAX won't allow dynamic filtering through the URL or PowerApps.
Here's how to make your DAX work with URL filters:
You don't need to extract values manually into variables (like varDate, varMgrID) when you're relying on URL-based filtering - instead, let Power BI's filter context do the job.Try using below DAX:
Team_Vol =CALCULATE(COUNTROWS(tbl_incidents),REMOVEFILTERS(tbl_incidents), -- Optional: removes other filters if neededtbl_incidents[Close_datecode],tbl_incidents[managerid])Individual_Vol =CALCULATE(COUNTROWS(tbl_incidents),REMOVEFILTERS(tbl_incidents),tbl_incidents[Close_datecode],tbl_incidents[userid])The key here is to not use SELECTEDVALUE or variables.Power BI already applies filters via the URL context, and CALCULATE picks them up directly.
URL Filter Format:
https://app.powerbi.com/....?filter=tbl_incidents/Close_datecode eq 202501 and tbl_incidents/managerid eq 'WXYZ' and tbl_incidents/userid eq 'ABCD'
Use no quotes for numeric fields (like Close_datecode).
Use single quotes for string fields (managerid, userid).
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi CoderV9 ,
You are absolutely right - hardcoding values like 202501 or "WXYZ" inside the DAX won't allow dynamic filtering through the URL or PowerApps.
Here's how to make your DAX work with URL filters:
You don't need to extract values manually into variables (like varDate, varMgrID) when you're relying on URL-based filtering - instead, let Power BI's filter context do the job.
Try using below DAX:
The key here is to not use SELECTEDVALUE or variables.Power BI already applies filters via the URL context, and CALCULATE picks them up directly.
URL Filter Format:
https://app.powerbi.com/....?filter=tbl_incidents/Close_datecode eq 202501 and tbl_incidents/managerid eq 'WXYZ' and tbl_incidents/userid eq 'ABCD'
Use no quotes for numeric fields (like Close_datecode).
Use single quotes for string fields (managerid, userid).
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Thank you v-venuppu I was able to get this fixed with the info you provided. Additonally found that when a PowerBI tile is embedded to PowerApps it cant accept more than one filter parameters. So had to create a custom column with concatenated values and then used a web filter 🙂
Thank you for your support on this..