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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
smileamile2
Resolver I
Resolver I

Slicer DAX

Error

1 ACCEPTED SOLUTION
smileamile2
Resolver I
Resolver I

Solution implemented was using default functionality of the new slicer visual. 

View solution in original post

12 REPLIES 12
smileamile2
Resolver I
Resolver I

Solution implemented was using default functionality of the new slicer visual. 

v-ssriganesh
Community Support
Community Support

Hi @smileamile2,

Could you please confirm if this issue has been resolved? If it has, kindly mark it as the solution and share the details in the community to help other members.
Thank you.

v-ssriganesh
Community Support
Community Support

Hi @smileamile2
,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-ssriganesh
Community Support
Community Support

Hi @smileamile2,
Thank you for posting your query in the Microsoft Fabric Community Forum.

May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

danextian
Super User
Super User

Hi @smileamile2 

 

You can unpivot all other columns but Color in the query editor so Status and State values are in one column or you can use a disconnected table and use a measure as a visual filter.

danextian_0-1741438502482.png

danextian_1-1741438517988.png

Filter = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    KEEPFILTERS (
        'Table'[Status]
            IN VALUES ( StatusOrState[Value] )
                || 'Table'[State] IN VALUES ( StatusOrState[Value] )
    )
)

 

danextian_2-1741438571461.png

danextian_3-1741438587147.png

danextian_4-1741438603026.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

HI @smileamile2 

 

Please update your formula to this:

Filter = 
VAR _VALUES =
    UNION ( VALUES ( StatusOrState[Value] ), { BLANK () } )
VAR _VALUES2 =
    VALUES ( StatusOrState[Value] )
RETURN
    IF (
        NOT ( ISFILTERED ( StatusOrState[Value] ) ),
        CALCULATE (
            COUNTROWS ( 'Table' ),
            KEEPFILTERS ( 'Table'[Status] IN _VALUES || 'Table'[State] IN _VALUES )
        ),
        CALCULATE (
            COUNTROWS ( 'Table' ),
            KEEPFILTERS ( 'Table'[Status] IN _VALUES2 || 'Table'[State] IN _VALUES2 )
        )
    )

danextian_0-1741490084014.png

Please see updated pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

 

x

 

hI @smileamile2 

 

Include an additional condition to check if the count of the selected values matches the total count when no selection is made. Try this:

Filter = 
VAR _VALUES =
    UNION ( VALUES ( StatusOrState[Value] ), { BLANK () } )
VAR _VALUES2 =
    VALUES ( StatusOrState[Value] )
VAR _ALL_SELECTED_TEST = COUNTROWS(ALL(StatusOrState)) = COUNTROWS(StatusOrState)
RETURN
    IF (
        NOT ( ISFILTERED ( StatusOrState[Value] ) ) || _ALL_SELECTED_TEST,
        CALCULATE (
            COUNTROWS ( 'Table' ),
            KEEPFILTERS ( 'Table'[Status] IN _VALUES || 'Table'[State] IN _VALUES )
        ),
        CALCULATE (
            COUNTROWS ( 'Table' ),
            KEEPFILTERS ( 'Table'[Status] IN _VALUES2 || 'Table'[State] IN _VALUES2 )
        )
    )

danextian_0-1741574226602.png

danextian_1-1741574242135.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Thanks for danextian and Ashish_Mathur's concern about this issue.

 

Hi, @smileamile2 

 

Please try the following DAX:

Filter = 
VAR _VALUES =
    UNION ( VALUES ( StatusOrState[Value] ), { BLANK () } )
VAR _VALUES2 =
    VALUES ( StatusOrState[Value] )
RETURN
    IF (
        NOT ( ISFILTERED ( StatusOrState[Value] ) ),
        CALCULATE (
            COUNTROWS ( 'Table' ),
            KEEPFILTERS ( 'Table'[Status] IN _VALUES || 'Table'[State] IN _VALUES )
        ),
        IF (
            COUNTROWS ( _VALUES2 ) = 1,
            CALCULATE (
                COUNTROWS ( 'Table' ),
                KEEPFILTERS ( 'Table'[Status] IN _VALUES2 || 'Table'[State] IN _VALUES2 )
            ),
            CALCULATE (
                COUNTROWS ( 'Table' ),
                KEEPFILTERS ( 'Table'[Status] IN _VALUES2 && 'Table'[State] IN _VALUES2 )
            )
        )
    )

 

Output:

vfenlingmsft_1-1741573565142.png

 

vfenlingmsft_2-1741573578931.png

 

vfenlingmsft_3-1741573592687.png

 

I have attached the pbix file for that example below, I hope it helps!

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1741400079603.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

x

PBI file attached.

Ashish_Mathur_0-1741476570229.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.