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
jess_v
Frequent Visitor

Error handling for URL filtering

Hello,

 

I am working on creating a URL that will pass a query string parameter to the Power BI report.  Is there any way to handle errors for this?

 

For example, If I have a table COURSES 

COURSE_IDCOURSE_NAME
1Math
2English
3Chemistry

 

And the URL is 

 

app.powerbi.com/groups/me/apps/app-id/reports/report-id/ReportSection?filter= COURSES/COURSE_NAME eq 'Physics'

 

is there any way for me to display the text "There are no courses with a course name of 'Physics'" to the user?

 

Thanks for your help!

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @jess_v ,

 

You could create a new slicer and use parameter to select the value in the slicer.

Then you could use SELECTEDVALUE() function to create a measure.

Measure =
IF (
    ISFILTERED ( 'Slicer'[Column] ),
    IF (
        SELECTEDVALUE ( 'Slicer'[Column] ) = SELECTEDVALUE ( 'Table'[Column] ),
        SELECTEDVALUE ( 'Table'[Column] ),
        "There are no courses with a course name of '"
            & SELECTEDVALUE ( 'Slicer'[Column] ) & "'"
    )
)

 Here is the result.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @jess_v ,

 

You could create a new slicer and use parameter to select the value in the slicer.

Then you could use SELECTEDVALUE() function to create a measure.

Measure =
IF (
    ISFILTERED ( 'Slicer'[Column] ),
    IF (
        SELECTEDVALUE ( 'Slicer'[Column] ) = SELECTEDVALUE ( 'Table'[Column] ),
        SELECTEDVALUE ( 'Table'[Column] ),
        "There are no courses with a course name of '"
            & SELECTEDVALUE ( 'Slicer'[Column] ) & "'"
    )
)

 Here is the result.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors