rchitect-of-info
rchitect-of-info

Reputation: 1586

Handling of selectedvalue when both options are chosen

I am trying to create a dynamic chart tile when using drill-down. One of my slicers looks like this:

enter image description here

Here is my DAX formula for creating the snippet of the chart title:

var Standard = if(
isfiltered(yrs_data[Standard]),
    if(exact(SELECTEDVALUE(yrs_data[Standard]),"Yes"),
        "LOT TYPE=PROD",
        "LOT TYPE=ENG"
    ),
"LOT TYPE=ALL"
)

The chart title works correctly except when both 'Yes' and 'No' are selected, then it incorrectly chooses "LOT TYPE=ENG", where I want it to be "LOT TYPE=ALL".

thx

Upvotes: 1

Views: 61

Answers (1)

smpa01
smpa01

Reputation: 4282

Can you try this

test =
IF (
    ISFILTERED ( yrs_data[Standard] ),
    IF (
        EXACT ( SELECTEDVALUE ( yrs_data[Standard] ), "Yes" ),
        "LOT TYPE=PROD",
        IF (
            EXACT ( SELECTEDVALUE ( yrs_data[Standard] ), "No" ),
            "LOT TYPE=ENG",
            "LOT TYPE=ALL"
        )
    )
)

Solution

Upvotes: 2

Related Questions