Forum Discussion

sasdfasdfsad's avatar
sasdfasdfsad
Icon for Advocate IV rankAdvocate IV
1 year ago
Solved

Consume URL Filter with DAX??? (echo back to page)

Is there anyway to "consume" a URL Filter in a PBI report with DAX to use it programatically for other purposes?

EDIT

If someone uses a URL parameter filter in PBI:  ?filter=TableName/ColumnEmail eq '[email protected]

Is there anyway that DAX can read the page level filters and echo them back to the page for example?

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from pallavi_r.

     

    Hi sasdfasdfsad ,

     

    Based on your description I used the example data in Power BI Desktop for testing and you can create a measure similar to: 

    SelectedCountries =
    "?filter=financials/Country in ("
        & CONCATENATEX (
            VALUES ( 'financials'[Country] ),
            "'" & 'financials'[Country] & "'",
            ", "
        ) & ")"

     

    Then use this measure to create a card visual:

     

    Append strings to URL in Power BI Service:

     

     

    Result:

     

    If there are problems with the results, clear the other filters.

     

     

    Best Regards,
    Zhu

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from pallavi_r.

     

    Hi sasdfasdfsad ,

     

    Based on your description I used the example data in Power BI Desktop for testing and you can create a measure similar to: 

    SelectedCountries =
    "?filter=financials/Country in ("
        & CONCATENATEX (
            VALUES ( 'financials'[Country] ),
            "'" & 'financials'[Country] & "'",
            ", "
        ) & ")"

     

    Then use this measure to create a card visual:

     

    Append strings to URL in Power BI Service:

     

     

    Result:

     

    If there are problems with the results, clear the other filters.

     

     

    Best Regards,
    Zhu

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

    • sasdfasdfsad's avatar
      sasdfasdfsad
      Icon for Advocate IV rankAdvocate IV

      Good point, I edited the post to try to be more clear.

      Is there anyway to "echo back" the currently applied page filters to the page?  Like a DAX measure that consumes/sees what the page filters are and then I can use that to print on the page?