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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Rewind
Helper I
Helper I

If filter is "Multiple Values"?

I'm very new to Power BI so apologies if this seems like an easy solution.

 

I'm not sure if the following is possible but ideally I'd like to create a new measure where.

 

If the filter for [Name] has Multiple selected calculate x

If the filter for [Name] has only one selected calculate y

 

 

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

@Rewind

 

Try HASONEVALUE or HASONEFILTER functions in DAX

 

SOmething like

 

=
IF ( HASONEVALUE ( Table1[Name] ), [Measure1], [Measure2] )

View solution in original post

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Rewind,

 

What can we do with the no selected? It could be like this one.

 

Measure 23 =
VAR total =
    CALCULATE ( COUNT ( DimProduct[ColorName] ), ALL ( DimProduct[ColorName] ) )
RETURN
    IF (
        HASONEVALUE ( DimProduct[ColorName] ),  // one selected.
        [Y],
        IF (
            COUNT ( DimProduct[ColorName] ) > 1
                && COUNT ( DimProduct[ColorName] ) < total,  //multi-selected.
            [X],
            [Other Measure]  // no selected.
        )
    )

 

Best Regards,
Dale

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

View solution in original post

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Rewind,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Rewind,

 

What can we do with the no selected? It could be like this one.

 

Measure 23 =
VAR total =
    CALCULATE ( COUNT ( DimProduct[ColorName] ), ALL ( DimProduct[ColorName] ) )
RETURN
    IF (
        HASONEVALUE ( DimProduct[ColorName] ),  // one selected.
        [Y],
        IF (
            COUNT ( DimProduct[ColorName] ) > 1
                && COUNT ( DimProduct[ColorName] ) < total,  //multi-selected.
            [X],
            [Other Measure]  // no selected.
        )
    )

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Zubair_Muhammad
Community Champion
Community Champion

@Rewind

 

Try HASONEVALUE or HASONEFILTER functions in DAX

 

SOmething like

 

=
IF ( HASONEVALUE ( Table1[Name] ), [Measure1], [Measure2] )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors