cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Ouput the original value when a single option from slicer is selected, Ouput "NA" when multiple.

So I am using a table visual which has multiple columns, There is this 1 column where I need to show the original value when a single option is selected and "NA" when there is a multi select in the table itself.

This is what should happen on single select-->>

This is what should happen on Multi select-->>

Need to complete this ASAP. Any help is appreciated. Cheers.

1 ACCEPTED SOLUTION
Community Support

According to your description, I create a sample.

Put Column1 in a slicer, then create a measure to show Column2 when there is a single option is selected in the slicer otherwise display NA. Here's my solution, create a measure(not calculated column because it can't change by the slicer selection).

``````Measure =
IF (
COUNTROWS ( ALLSELECTED ( 'Table'[Column1] ) ) = 1,
MAX ( 'Table'[Column2] ),
"NA"
)
``````

Then get the result.

You may need to tweak the formula a bit depending on your sample, but this is the basic idea.

I attach my sample below for your reference.

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
Community Support

According to your description, I create a sample.

Put Column1 in a slicer, then create a measure to show Column2 when there is a single option is selected in the slicer otherwise display NA. Here's my solution, create a measure(not calculated column because it can't change by the slicer selection).

``````Measure =
IF (
COUNTROWS ( ALLSELECTED ( 'Table'[Column1] ) ) = 1,
MAX ( 'Table'[Column2] ),
"NA"
)
``````

Then get the result.

You may need to tweak the formula a bit depending on your sample, but this is the basic idea.

I attach my sample below for your reference.

Best Regards,
Community Support Team _ kalyj

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

Frequent Visitor

Can you share me the code or something. Not heard of it. Will be a great help. Thanks for the reply

Solution Sage

Just use the HASONEFILTER function to make decisions in your DAX code.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors
Top Kudoed Authors