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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PowerrrBrrr
Helper III
Helper III

Filter not working as expected

I have below which for some reason gives me (Blank) even if there is no selection made. Selection is made by clicking on a different cards visual in the report. So if there is no card selected it should give me "No Id Selected"  but instead it gives me "Selected ID:"
What is wrong with below DAX?

 

Selected Pump = IF(
ISFILTERED(Class[Id]),"Selected ID:"
SELECTEDVALUE(Class[Id]),"No Id Selected"
)
2 ACCEPTED SOLUTIONS
v-henryk-mstf
Community Support
Community Support

Hi @PowerrrBrrr ,

 

According to your description, I have done tests that show the results very well, with the following reference.

M_ = 
IF (
    ISFILTERED ( Class[ID] ),
    "Selected ID:" & SELECTEDVALUE ( Class[ID] ),
    "No Id Selected"
)

vhenrykmstf_0-1635217222310.png

vhenrykmstf_1-1635217232680.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

v-henryk-mstf
Community Support
Community Support

Hi @PowerrrBrrr ,

 

I reproduced your problem and it is the filter condition in Filters that is causing the problem.

vhenrykmstf_0-1635234781473.png

 

Remove the fields from Filter on all pages and filter directly by slicer. Refer to the following.

vhenrykmstf_1-1635234864781.png

 


Best Regards,
Henry


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

View solution in original post

7 REPLIES 7
v-henryk-mstf
Community Support
Community Support

Hi @PowerrrBrrr ,

 

I reproduced your problem and it is the filter condition in Filters that is causing the problem.

vhenrykmstf_0-1635234781473.png

 

Remove the fields from Filter on all pages and filter directly by slicer. Refer to the following.

vhenrykmstf_1-1635234864781.png

 


Best Regards,
Henry


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

Yes that works, but would like to know why this does not work with Filter on Pages??I am here just cleaning the data and removing blank

Hi @PowerrrBrrr ,

 

ISFILTERED function is to return TRUE when the specified table or column is directly filtered, otherwise it returns FALSE. when the data or blank in Filter is not cleared, the judgment condition will still be in effect. This is the cause of the error.


Best Regards,
Henry


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

v-henryk-mstf
Community Support
Community Support

Hi @PowerrrBrrr ,

 

According to your description, I have done tests that show the results very well, with the following reference.

M_ = 
IF (
    ISFILTERED ( Class[ID] ),
    "Selected ID:" & SELECTEDVALUE ( Class[ID] ),
    "No Id Selected"
)

vhenrykmstf_0-1635217222310.png

vhenrykmstf_1-1635217232680.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Hi @v-henryk-mstf 

I did your way and its still not working..there is no error. please see the below screen shot. I have not selected anything, still its takes the first condition in filter

PowerrrBrrr_0-1635232931828.png

 

amitchandak
Super User
Super User

@PowerrrBrrr , Hope you have joined strings with &

Selected Pump = IF(
ISFILTERED(Class[Id]),"Selected ID:" & SELECTEDVALUE(Class[Id]),"No Id Selected"
)

Yes i have appended with & but it still do not work

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.