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
LalitoBLM
New Member

The card visual is not displaying "all"

Hi,

 

I'm very new to PowerBI but I visit discussions on these forums for the great help in my development.

 

I'm working on a simple report to display and filter instruments by type showing the count for each. I have used the following code to seach Column1 for values Value1 and Value2 and assign ValueA to them under the JointInstType:

 

 

JointInstType = IF(
	ISERROR(
		SEARCH("Value1", Table1[Column1])
	),
	IF (ISERROR(
		SEARCH("Value2", Table1[Column1])
	),
FIRSTNONBLANK(Table1[Column1], 1),
"ValueA"),
	"ValueA"
)

 

 

The report works; however, the for the "select all" slicer it displays ValueA which should display "All".

How do I change the code to display all?

 

I appreciate your help.

1 REPLY 1
nandukrishnavs
Super User
Super User

@LalitoBLM 

 

Try below DAX.

JointInstType =
IF (
    ISERROR ( SEARCH ( "Value1", Table1[Column1] ) ),
    IF (
        ISERROR ( SEARCH ( "Value2", Table1[Column1] ) ),
        FIRSTNONBLANK ( Table1[Column1], 1 ),
        "ValueA"
    ),
    IF ( NOT ( ISFILTERED ( Table1[SlicerColumn] ) ), "All", "ValueA" )
)

 

If this is not working then please share the PBIX file or sample input table and expected output.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

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.