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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Select value filter

Hello, I have made 2 measures for drill through and its working perfect. The question is about dax if there is a way that i could assign department filter and eliminate clicking manually on table department. A measure that i could duplicate and assign for each of departments
 
 
Selected PN =
    var selectedPN =
        SELECTEDVALUE(DimPnRework[pn])
    return
        "pn:"  & IF(ISBLANK(selectedPN), "All pn", selectedPN)
 
Selected department =
    var selecteddepartment =
        SELECTEDVALUE('pl_master_data bledy_hmd'[dzos])
    return
        "Yield:"  & IF(ISBLANK(selecteddepartment), "All Yield", selecteddepartment)
 
 lukaszEltwin1_0-1663058515899.png

 

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

Hi @Anonymous,

AFAIK, the current DAX expressions are not able to affect the filter/slicer selections. You can't use them to change the selection or cancel current activities items.

If you means to ignore the filter interatiosn from a specific field, you can use isfiltered with all functions to ignore specific filters to affect the DAX formula calculations.

ISFILTERED, ISCROSSFILTERED – DAX Guide - SQLBI

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

BTW, selectedvalue function is suitable for single selection, if you selected multiple items without setting 'alternate Result' it will return a blank result. You can try to use the following formula to show current selections:

 

Selected PN =
VAR selectedPN =
    CONCATENATEX ( VALUES ( DimPnRework[pn] ), [pn], "," )
RETURN
    "pn:"
        & IF (
            COUNTROWS ( VALUES ( DimPnRework[pn] ) )
                = COUNTROWS ( DISTINCT ( ALL ( DimPnRework[pn] ) ) ),
            "All pn",
            selectedPN
        )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

AFAIK, the current DAX expressions are not able to affect the filter/slicer selections. You can't use them to change the selection or cancel current activities items.

If you means to ignore the filter interatiosn from a specific field, you can use isfiltered with all functions to ignore specific filters to affect the DAX formula calculations.

ISFILTERED, ISCROSSFILTERED – DAX Guide - SQLBI

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

BTW, selectedvalue function is suitable for single selection, if you selected multiple items without setting 'alternate Result' it will return a blank result. You can try to use the following formula to show current selections:

 

Selected PN =
VAR selectedPN =
    CONCATENATEX ( VALUES ( DimPnRework[pn] ), [pn], "," )
RETURN
    "pn:"
        & IF (
            COUNTROWS ( VALUES ( DimPnRework[pn] ) )
                = COUNTROWS ( DISTINCT ( ALL ( DimPnRework[pn] ) ) ),
            "All pn",
            selectedPN
        )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors